holiber / sl-vue-tree

Customizable draggable tree component for Vue.js
https://holiber.github.io/sl-vue-tree/
MIT License
345 stars 78 forks source link

Optimized event listeners #3

Closed Alex-Sokolov closed 6 years ago

Alex-Sokolov commented 6 years ago

Optimized event listeners

When we call methods, event will passed as 1st argument:

@mousemove="onNodeMousemoveHandler"

We can use event modifiers:

@dragover.prevent

We can use $event variable to pass event where we want

@drop="onNodeDropHandler($event, node)"
@dblclick="emitNodeDblclick(node, $event)"
holiber commented 6 years ago

Thanks for the PR