Subscribe on changes!

keep-alive组件里面的变量storageContainer存在内存泄漏

avatar
Feb 1st 2024

Vue version

lastest

Link to minimal reproduction

--

Steps to reproduce

temp_image_20240201182951

keep-alive组件里面的变量storageContainer好像存在内存泄漏。

组件卸载的时候没有从storageContainer里面删掉vnode

What is expected?

--

What is actually happening?

--

System Info

No response

Any additional comments?

No response

avatar
Feb 1st 2024

是否可以在pruneCacheEntry函数中加一段判断, 内容如下 let index = Array.from(storageContainer.children).indexOf(cached.el); if (index >= 0) storageContainer.removeChild(storageContainer.childNodes[index])

avatar
Feb 6th 2024

我是通过exclude赋值组件名, 要将组件从缓存中去掉的

avatar
Feb 6th 2024

Please make sure to have valid reproductions when reporting issues. Just claiming there is a leak doesn't help.