NPM:
npm i --save vue-attach-event
Require it in your main.js (or index.js) file:
// ES6
import 'vue-attach-event';
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">
{
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.
MIT
- Add event modifiers
- Handler when config object changes