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

Computed properties on an instance can get tied to the active scope VM rather than the instance itself #12705

Closed
chearon opened this issue Jul 27, 2022 · 0 comments

Comments

@chearon
Copy link
Contributor

chearon commented Jul 27, 2022

Version

2.7.8

Reproduction link

jsfiddle.net/p0Leh19d/

Steps to reproduce

  1. In the fiddle, hit the "increase X" button to see the watcher working.
  2. Click "Use new instance of component"
  3. Hit "increase X"
  4. The computed doesn't update

If you change the URL to Vue 2.6, the example does work.

In Vue 2.7.x, computed properties can get destroyed and stop working if their instance is created inside of another component's created, but the instance is also used again by another component later.

What is expected?

Computed properties should only be torn down by their own instance

What is actually happening?

Computed properties are getting torn down by another instance destroying


To me it looks like the conditional on this line should be reversed: shouldn't it be vm._scope || activeEffectScope?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant