Skip to content

对于vue3 transition 和 生命周期 unmounted 我有一个小小的疑问 #8968

Discussion options

You must be logged in to vote

unMounted执行的时候,DOM应该已经被移除掉了

并不是,只是组件 unmount 了,DOM 则可能被 Transition 推迟移除。

假如我在这个事件中做了其它的操作的话,比如绑定全局事件,那么我就无法在unmounted事件中对全局事件进行解绑。

的确有这个风险。我觉得我们应该重新考虑 https://github.com/vuejs/core/issues/661。

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by 2507483326
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants