-
Notifications
You must be signed in to change notification settings - Fork 133
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
Treat onCustomEvent as on-custom-event #164
Comments
@thenickname, fair point, but I am not sure we want to convert all events to |
@nickmessing I agree we should fix this in core by creating both camelCase and kebab-case versions of all listeners. 🙂 |
@nickmessing Evan's reasoning in this issue makes sense to me, so I think we probably have to close this unfortunately. @thenickname While I like the idea, it would make some technically valid events impossible to listen for in JSX. On the bright side, I've just submitted a proposal to the team to strictly enforce lowercase event names in Vue 3, which would solve this problem and many others related to events. 🎉 |
This is a suggestion to make event attribute names in JSX more consistent with other props and attributes. Among other things this would simplify providing event types for TSX and make better use of the already existing editor support (vscode)
The problem: If a vue component emits following event:
It is impossible to listen for it in JSX using
camelCase
:One is forced to do one of the following:
While the above examples do work, they are somewhat inconsistent with how all other JSX attributes are usually written. I belive it is more common to have all attributes
camelCase
.Also, when working with TSX in vscode, autocomplete suggestions for props are all
camelCase
. However, because vue events likecustom-event
do not translate toonCustomEvents
in JSX it makes things more difficult when working with Vue, TypeScript and TSX.The text was updated successfully, but these errors were encountered: