vue
vue copied to clipboard
Use vue.extend to create a new component, call the method in beforeDestroy, there is no response,it is working in 2.6
Version
2.7.8
Reproduction link
Steps to reproduce
1.Use Vue.extend to create a new component Notify. 2.call Notify() to show blue square in mounted method 3.call close() to hide blue square in beforeDetroy method,but it doesn't work
What is expected?
The blue square can be closed in beforeDestroy.
What is actually happening?
The blue square still show when call beforeDestroy method.
Because I use element-ui's Notification component, its implementation is similar to the above, it cannot be closed in beforeDestroy, or even onbeforeUnmount in setup syntax. Also, the onBeforeUpdate is able to close.
The same logic work in Vue@3.
Demo: https://jsbin.com/lizeqic/edit?html,output