-
-
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
component calls update hook after it is destroyed #8076
Comments
@BL-Lac149597870 In your reproduction link, you have not defined your components as |
@mbj36 my bad.Now i have just corrected the mistake and changed the repo link,but the problem still remains... |
@BL-Lac149597870 It's always better to use computed property or watcher - See the api docs here - https://vuejs.org/v2/api/#updated |
@mbj36 Thank you for your reply. But I didn't perform any DOM-dependent operations when the updated hook was called.And according to Vue lifecycle,after one component is destroyed,its updated hook shouldn't be called.But in my repo,this condition happens.I can't figure out how this happens. |
Met this problem, too. |
@shockw4ver Maybe we can work it out together,hahaha~ |
I hate to bring bad news, but the fix only triggers the update part of the lifecycle, leaving Use the sandbox above with |
…stroyed, fix vuejs#8076 fix references to beforeUpdate spy
Version
2.5.2
Reproduction link
https://codesandbox.io/s/ympx4pk72z
Steps to reproduce
1、click the home link
2、click the test link
What is expected?
after the Home component destroyed,its updated hook should not be called
What is actually happening?
after the Home component destroyed,its updated hook is called
here is the log information
Home beforeCreate
Home created
Home beforeMount
Home mounted
Test beforeCreate
Test created
Test beforeMount
Home beforeDestroy
Home destroyed
Test mounted
Home updated
why the Home component can call updated hook after it is destroyed?
Is Vue designed to do so?
The text was updated successfully, but these errors were encountered: