-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Lifecycle hooks is executed in the wrong order. #8898
Comments
There is a unit test to ensure the order is correct. It can be found below:
I'm uncertain how to reconcile your reproduction case with this. Something maybe wrong with your test case - I wouldn't expect onBeforeUnmount to be called at all when you click open. |
The key point in reproducing the problem is Change const effectiveList = computed(() => list.value.filter(it => !visible.value || it !== selectedItem.value)) Console will print:
|
same problem: element-plus#15145 |
Note: The |
Vue version
3.3.4
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-avbi9v?file=src%2FApp.vue
Steps to reproduce
open:0
buttonclose
buttonopen:1
buttonWhat is expected?
Console log:
OR:
What is actually happening?
Console log:
System Info
Any additional comments?
In this demo, Item's lifecycle hooks are sometimes executed in this order:
onBeforeMount->onBeforeUnmounted->onMounted->onUnmounted
The text was updated successfully, but these errors were encountered: