Open Razenpok opened 6 years ago
Anything?
Unfortunately, the original reproduction links provided in the issue are non-functional. To contribute to the discussion, I attempted to replicate the described issue based on its description.
I observed a peculiar behavior: when a nested field is bound directly to a prop, changes to its value do not trigger the watch mechanism within the component. However, if the entire object is passed to the component, the watch mechanism activates as expected. This distinction likely stems from Vue.js's reactivity system, where props of an inactive component do not register changes. While this behavior makes sense from a technical standpoint, it intuitively feels odd and could potentially lead to confusion.
For clarity and further investigation, I've attempted to outline my reproduction steps in a Vue.js playground, though I'm unsure if my approach aligns with the expected behavior due to the original link's inactivity:
Version
2.5.17
Reproduction link
https://refactoring.ninja/vue-v-if-keep-alive/ https://github.com/Razenpok/vue-v-if-keep-alive
Steps to reproduce
What is expected?
player.money
remains the sameWhat is actually happening?
player.money
goes upComponent "DoesntUpdate" doesn't update on "Add stuff" as expected - it is bound to
lives
property which is on top level ofdata
.This isn't a dev tools issue, as I observe the same behavior with devtools disabled