vue-attach-event

1.0.5 • Public • Published

vue-attach-event

Directive to be able to attach events through other events on HTML elements in VueJS

Install

NPM:

npm i --save vue-attach-event

Require it in your main.js (or index.js) file:

// ES6
import 'vue-attach-event';

Usage instructions

Add v-attach-event as an attribute on the element you wish to handle a new event and pass and config object:

<button v-attach-event="config" @click="handler" @my-event="handler2">

Config

{
  on: 'eventName',
  newEvent: 'newEventName'
}
  • on (Required): Name of the original event that will trigger the new event.
  • newEvent (Required): Name of the new event to run with the original event.

License

MIT

TODO

  • Add event modifiers
  • Handler when config object changes

Package Sidebar

Install

npm i vue-attach-event

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

4.02 kB

Total Files

6

Last publish

Collaborators

  • ajomuch92