-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Event names using camelCase #308
Comments
@privatenumber thank you for spotting this! Fixed via c09d1a5 and added a working codepen to prevent confusion 😅 |
Awesome! Thanks for addressing it so fast. Minor nitpick -- I would clarify that the second-half of the event name |
@NataliaTepluhina Is it alright if I make a follow up PR to address those points? I don't want to put time into it if it's not welcome but I would love to contribute to help improve the docs. |
@privatenumber That sounds great. Looking forward to the PR! |
Closing this one as we might rethink the whole camelCase vs kebab-case recommendation (see #656) |
The Custom Events page sets a confusing and contradicting recommendation on event-name conventions.
At the top it recommends using kebab-case because HTML is case-insensitive:
However, a lot of code examples starting from the "Multiple v-model bindings" section contains camelCase event names:
$emit('update:firstName', $event.target.value)
->v-model:firstName="firstName"
This statement seems inaccurate too, considering part of the event name (eg.
update:dataProperty
) maps to a view-model property:Edit:
v-model.prop-name="..."
where the emitted event can be either camelCase (update:propName
) or kebab-case (update:prop-name
) works. CodepenThe text was updated successfully, but these errors were encountered: