You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
381 B
12 lines
381 B
3 months ago
|
import events from './events.js'
|
||
|
|
||
|
export default function (instance, eventList) {
|
||
|
const ev = eventList || events[this.$options.name]
|
||
|
ev && ev.forEach(event => {
|
||
|
const hasOn = event.slice(0, 2) === 'on'
|
||
|
const eventName = hasOn ? event.slice(2) : event
|
||
|
const listener = this.$listeners[eventName]
|
||
|
listener && instance.addEventListener(event, listener.fns)
|
||
|
})
|
||
|
}
|