You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is actually because the use of in-DOM templates. The innerHTML is normalized by the browser and converts all attributes names to lowercase before Vue's compiler can handle it.
i.e. onUpdate:modelValue is converted to onUpdate:modelvalue, so the event names won't match.
When using in-dom templates, event names should also follow the kebab case convention:
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: