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

v-on event listener name mangling nuance #3127

Open
noellelevydialpad opened this issue Dec 11, 2024 · 1 comment
Open

v-on event listener name mangling nuance #3127

noellelevydialpad opened this issue Dec 11, 2024 · 1 comment

Comments

@noellelevydialpad
Copy link

- A `v-on` event listener like `@click` will be exposed on the object as a function under `$attrs.onClick`.

This does not make it entirely clear that the conventional kebab casing of event names would be camel cased i.e. @my-event would result in an attr named onMyEvent.
And it also does not document how any uppercase letter makes it simply prefix on: to the name with no transform, like @My-event yields on:My-event

@noellelevydialpad
Copy link
Author

noellelevydialpad commented Dec 11, 2024

Upon further investigation it only generates the on:My-event type for elements which are not components and it is harder to get your hands on those event handlers. The full camel case transformation should probably be more clearly documented though.

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