-
-
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
Strange behaviour with prop inheritance (modelValue) #1989
Comments
If I append an empty |
Also when I add |
I believe this is because Explicitly adding |
I think it's important to distinguish model update events from any other events exactly for this to work. Model update event listeners should have a special treatment which they do have right now. But in a case of I've created an RFC to fix that. |
Version
3.0.0-rc.9
Reproduction link
https://jsbin.com/wukoruyuru/edit?html,js,output
Steps to reproduce
What is expected?
modelValue props (maybe props with the same name) should be isolated in each component.
What is actually happening?
There seems to be a different behaviour in Vue 3 compared to Vue 2. When passing data to a v-model of a component (Component A), then passing it to another component (Component B), the data does not get modified/emitted in the first one (Component A).
Please see the example.
I expect the myData to be ‘from A’ (because it should be overwritten in Component A), but instead it results in ‘from B’. Even if I remove the $emit-Line in Component A I still get the same result. This is different from Vue2, is this the intended behaviour?
When I replace modelValue in ComponentB to let’s say modelValue1 and set its other references stuff then the sample is working like expected.
So when using a prop “modelValue” in a component and also “modelValue” in one of its sub components then the “bug” appears…
The text was updated successfully, but these errors were encountered: