-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Deep props change: v-model vs. this.$set() vs. Object.assign() #6670
Comments
|
I think that I'll have to find a way to construct the Question: can I use -- Cool! I can even use (after using |
@yyx990803 I do realize that to properly have tracking for nested substructure it's required to convert |
You can solve the problem with a deep value like this:
|
Version
2.4.1
Reproduction link
https://jsfiddle.net/spo7ywbh/
Steps to reproduce
Consider three examples:
1. v-model:
2. this.$set():
3. Object.assign():
What is expected?
I expect all three ways to work as expected. I.e.: if I look at
value
structure in the Vue dev tools, I can see its "leaves" to toggle between true and false as I check/uncheck checkboxes.What is actually happening?
In fact, only the third way works as expected. Moreover, 2nd way is also working, but… sometimes, which is unacceptable :-(
Maybe it's me getting the whole "reactivity" thing wrongly… However, in the documentation
this.$set()
is especially "promoted" in this matter.The text was updated successfully, but these errors were encountered: