v-model update being bubbled up on root components
Version
3.0.0-rc.4
Reproduction link
https://codesandbox.io/s/hungry-mendeleev-dfiy9
Steps to reproduce
- Open https://codesandbox.io/s/hungry-mendeleev-dfiy9
- Press count button
What is expected?
It should correctly increase count value to 3 and so on. Works on vue2.
What is actually happening?
Now it sets the whole wrapper object to that number, instead of the property.
Wrapping hello component in a div works as a workaround.
In your example your Hello component is using v-model but it should just pass a prop since it's not modifying its modelValue prop. Otherwise you have to provide the inheritAttrs: false option to it so it doesn't inherit the binding and event listener from its parent and put it on the Test component, which conflict with the added v-model. That's also why a wrapper fixes the problem.
You can find more information at existing RFCs like https://github.com/vuejs/rfcs/pull/31