2.4.0 • Published 5 years ago

vue-active-element v2.4.0

Weekly downloads
80
License
MIT
Repository
github
Last release
5 years ago

vue-active-element

what

a very candide fragment component for Vue.js

why

If you want to know if your user clicked on your element and get a boolean for it, it's sure easy ; if you want to know is that element lost user click-focus, it's a bit different. You may succeed in few lines, but why not a handy directive instead ?

How

The directive uses argument to get the reactive property to update from the vnode context, so it's actually possible to put this directive and update "parent" nodes.

Use

  • download the package npm i -s vue-active-element

From here, you can load a plugin version, or use the directive independently.

  • Plugin:

    import ActiveElement from 'vue-active-element'
    Vue.use(ActiveElement.Plugin)
    
    …
    
    export const MyComponent {
      template: '
      <div class="component">
        <div class="nested-child" v-active-element="property"></div>
      </v-fragment>
      ',
      data() { return { property: undefined }}
    }
  • Component:

    import AE from 'vue-active-element'
    
    export const MyComponent {
      directives: { isclick: AE.directive },
      template: '
      <div class="component">
        <div class="nested-child" v-isclick="property"></div>
      </v-fragment>
      ',
      data() { return { property: undefined }}
    }
2.4.0

5 years ago

2.3.0

5 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

6 years ago

1.0.5

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago