-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
camelCase events can be listened to in the kebab-case #656
Comments
@ota-meshi I think with So maybe as we started to use event name as a property name in |
There's a related bug for using kebab-case with I haven't seen anything official but it would seem that the intention is for event names to treat kebab-case and camelCase as equivalent in Vue 3, a bit like props. Assuming that is the case, it would make sense to me for the style guide recommendation to be similar to the recommendation for props. The introduction to the page on custom events is definitely going to need a rewrite once the correct behaviour is established. |
We've discussed this at the core team meeting and the plan is to change the recommended casing to the way we have for props:
On 3.0.3 the mentioned bug persists, to be fixed in 3.0.4 |
Thank you for discussing this issue! I think it makes sense. |
The documentation says it Won't work but it seems to work.
https://v3.vuejs.org/guide/component-custom-events.html#event-names
I checked in the following source code.
Also, if I use a compiled component, I will get a warning if I define the emits option in the kebab-case.
vuejs/eslint-plugin-vue#1347
The recommended casing for the event name is the kebab-case, but should we actually recommend the camelCase?
The text was updated successfully, but these errors were encountered: