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

Use vue.extend to create a new component, call the method in beforeDestroy, there is no response,it is working in 2.6 #12701

Closed
Ch2x opened this issue Jul 27, 2022 · 1 comment

Comments

@Ch2x
Copy link

Ch2x commented Jul 27, 2022

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.

@JuniorTour
Copy link
Contributor

The same logic work in Vue@3.

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

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

2 participants