fuminchao
fuminchao

Reputation: 311

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.

Neither are deactivated, destroyed.

The component is "disappeared", when I remove it from the collection "windows".

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

Upvotes: 31

Views: 41401

Answers (1)

user2066755
user2066755

Reputation: 533

In Vue 3 beforeDestroy and destroyed hooks are replaced with beforeUnmount and unmounted https://v3.vuejs.org/api/options-lifecycle-hooks.html#beforeunmount

Upvotes: 51

Related Questions