简体   繁体   English

Vue3 中未发出生命周期钩子 beforeDestroy

[英]Lifecycle hook beforeDestroy is not emitted in Vue3

I use vue3 beta 18, found that beforeDestroy is not emitted when I remove a component which is rendered by dynamic component in v-for.我使用 vue3 beta 18,发现当我删除由 v-for 中的动态组件呈现的组件时,不会发出 beforeDestroy。

Neither are deactivated, destroyed.两者都没有被停用,被破坏。

The component is "disappeared", when I remove it from the collection "windows".当我从集合“windows”中删除它时,该组件“消失”了。

<template>
component(v-for="ww in windows" :key="ww.$id" :is="ww.component" v-bind="ww.props")
</template>

In Vue 3 beforeDestroy and destroyed hooks are replaced with beforeUnmount and unmounted https://v3.vuejs.org/api/options-lifecycle-hooks.html#beforeunmount在 Vue 3 中 beforeDestroy 和被破坏的钩子被替换为 beforeUnmount 和卸载https://v3.vuejs.org/api/options-lifecycle-hooks.html#beforeunmount

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM