Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'nodeOpenChanged' events cannot be listened #107

Open
AndreaZanuccoli opened this issue Jun 15, 2020 · 0 comments
Open

'nodeOpenChanged' events cannot be listened #107

AndreaZanuccoli opened this issue Jun 15, 2020 · 0 comments

Comments

@AndreaZanuccoli
Copy link

AndreaZanuccoli commented Jun 15, 2020

'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.

@AndreaZanuccoli AndreaZanuccoli changed the title Can't listen to nodeOpenChanged event 'nodeOpenChanged' events cannot be listened Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant