vue icon indicating copy to clipboard operation
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

Open Ch2x opened this issue 1 year ago • 1 comments

Version

2.7.8

Reproduction link

codepen.io/Ch2x/pen/VwXMbJm

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.

Ch2x avatar Jul 27 '22 04:07 Ch2x

The same logic work in Vue@3.

Demo: https://jsbin.com/lizeqic/edit?html,output

JuniorTour avatar Jul 30 '22 16:07 JuniorTour