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

Data property read in prop watch treated as a rendering dependency #2728

Closed
skirtles-code opened this issue Dec 4, 2020 · 1 comment
Closed
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. 🐞 bug Something isn't working

Comments

@skirtles-code
Copy link
Contributor

Version

3.0.4

Reproduction link

https://jsfiddle.net/skirtle/yuq96a0c/

Steps to reproduce

  1. Click 'Button 1'.
  2. Click 'Button 2'.
  3. Note the logging.

What is expected?

Clicking 'Button 2' should not cause anything to be logged.

What is actually happening?

Clicking 'Button 2' is logging a message, indicating that the component has re-rendered.


Clicking the first button causes a prop to change, triggering the watcher. The watcher accesses a property, which is then incorrectly tracked as a rendering dependency.

I reported this previously as part of #2521 but it was only partially fixed.

@edison1105
Copy link
Member

edison1105 commented Dec 5, 2020

a little complicated
https://github.com/vuejs/vue-next/blob/8936e53b10a507b80ffc5b0ecaa6a1a0322f46cc/packages/runtime-core/src/componentOptions.ts#L903-L937
Maybe, need to use pauseTracking, resetTracking wraps handler.

@posva posva added 🐞 bug Something isn't working 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. labels Dec 11, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Oct 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. 🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants