Subscribe on changes!

why $destroy was removed?

avatar
Apr 26th 2021

What problem does this feature solve?

Hello, why $destroy was removed? I'm sorry that I didn't find a detailed explanation, only a simple explanation. 'Users should no longer manually manage the lifecycle of individual Vue components'.

When using Keep-Alive to cache multiple instances of the same component, a component instance needs to be destroyed manually.

What does the proposed API look like?

this.$destroy()

avatar
Apr 26th 2021

See https://v3.vuejs.org/guide/migration/introduction.html#removed-apis

Users should no longer manually manage the lifecycle of individual Vue components.

Regarding KeepAlive cache management, you can track it in https://github.com/vuejs/rfcs/pull/284

avatar
Apr 26th 2021

Regarding KeepAlive cache management, you can track it in vuejs/rfcs#284 thank you