phphe / vue-draggable-nested-tree

Vue2 draggable tree component
https://hetree.phphe.com/
MIT License
344 stars 62 forks source link

'nodeOpenChanged' events cannot be listened #107

Open AndreaZanuccoli opened 4 years ago

AndreaZanuccoli commented 4 years ago

'nodeOpenChanged' events can't be listened due to this motivation: FROM vue.js site https://vuejs.org/v2/guide/components-custom-events.html#Event-Names

Event Names Unlike components and props, event names don’t provide any automatic case transformation. Instead, the name of an emitted event must exactly match the name used to listen to that event. For example, if emitting a camelCased event name:

this.$emit('myEvent')

Listening to the kebab-cased version will have no effect:

<!-- Won't work --> <my-component v-on:my-event="doSomething"></my-component>

Unlike components and props, event names will never be used as variable or property names in JavaScript, so there’s no reason to use camelCase or PascalCase. Additionally, v-on event listeners inside DOM templates will be automatically transformed to lowercase (due to HTML’s case-insensitivity), so v-on:myEvent would become v-on:myevent – making myEvent impossible to listen to.

For these reasons, we recommend you always use kebab-case for event names.