-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Inconsistency with v-model @update event names #656
Comments
This is actually because the use of in-DOM templates. The i.e. When using in-dom templates, event names should also follow the kebab case convention: <child-input
:model-value="myText"
@update:model-value="myText = $event"
></child-input> In 2.x, a two-way binding via For consistency, in 3.0 we should allow |
After the fix:
|
Version
3.0.0-alpha.3
Reproduction link
https://codesandbox.io/s/v-model-decomposed-camel-case-v337l
Steps to reproduce
v-model
to it.update:modelValue
event. Everything should work as expected: https://codesandbox.io/s/v-model-on-component-pex6sv-model
toThe value won't update properly: https://codesandbox.io/s/v-model-decomposed-camel-case-v337l
4. Now change event name to kebab-case on both parent and child components. It starts to work again: https://codesandbox.io/s/v-model-decomposed-kebab-case-jh7h7
What is expected?
As per RFC, everything should work fine with camelCased event name
What is actually happening?
When we decompose
v-model
to passedmodel-value
prop and emittedupdate:modelValue
event, it works only with kebab-cased event name.Please check the discussion on vuejs/docs#39 (comment)
The text was updated successfully, but these errors were encountered: