-
-
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
Inactive keep-alive component keeps updating if bound to nested properties #8819
Comments
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
The text was updated successfully, but these errors were encountered: