Skip to content
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

v-model update being bubbled up on root components #1715

Closed
Kurira opened this issue Jul 26, 2020 · 1 comment
Closed

v-model update being bubbled up on root components #1715

Kurira opened this issue Jul 26, 2020 · 1 comment

Comments

@Kurira
Copy link

Kurira commented Jul 26, 2020

Version

3.0.0-rc.4

Reproduction link

https://codesandbox.io/s/hungry-mendeleev-dfiy9

Steps to reproduce

  1. Open https://codesandbox.io/s/hungry-mendeleev-dfiy9
  2. 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.

@posva
Copy link
Member

posva commented Jul 27, 2020

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 vuejs/rfcs#31

@posva posva closed this as completed Jul 27, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Nov 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants