-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
onBeforeUnmount not invoked for specific dynamicChildren-optimized case #2444
Comments
In your repro const MyTest = {
template: "#my-test",
setup() {
Vue.onBeforeUnmount(() => {
console.log("MyTest umounted")
});
}
}
const App = {
components: {
MyTest
},
setup() {
const block = Vue.shallowRef({id:1});
setTimeout(() => {
console.log("this should unmount")
block.value = null;
}, 1000);
return {
block
}
}
}
Vue.createApp(App).mount("#main"); maybe that's what you meant |
the component was not unmounted at all
|
Excuse me. I've updated the example |
I think I've run into this same bug on Vue 3.2.47. I have one particular component which has two children, a slot, and a dialog, like: <template>
<slot :on-click="onClick"></slot>
<Dialog {some options} />
</template> In my I've been trying to create a reproduction on CodeSandbox and I haven't been able to do it. Is there any way to prevent this "optimized" path from taking place? |
Version
3.0.1
Reproduction link
https://codepen.io/basvanmeurs/pen/xxVoYVE?editors=1111
Steps to reproduce
Just run and view the console log
What is expected?
"MyTest umounted" is shown once
What is actually happening?
"MyTest umounted" is not shown
This behavior changed from 3.0.0 to 3.0.1.
Probably related to 376883d
The text was updated successfully, but these errors were encountered: