Subscribe on changes!

bug报告,当teleport组件的prop disabled为true时,会发生内存泄漏

avatar
Jun 4th 2023

Vue version

3.3.4

Link to minimal reproduction

https://play.vuejs.org/#eNp9Uktu2zAQvQrBjR3AIhfpypANF7lCu+NGlsaxGvEDfhQUhoAWKFB031WP0EW7CxDkOvneIkNJThTFyYKCyHkzb97M29GPxrA6AJ3T1OW2NJ448MEshSKklEZbT3ZkOyMWNqQhG6slmSB+MoifBOe1PNF4U6B8D2J89B5p2rR4cq0cUm31+Th7Eamm3gY4egYGJXVog9MjsliSXQyRQ/mszqoACNxklYMIa4RKeacNVeHFgzRV5qHVmBZlTeqk3CwEPVBO0BaFuE9QQSvXa4SudfFVUFKULltXUPQghI3yl+l4DPt6fF+wa4NjH93fOnivFVnlVZmfIVWv/amTh9/fbv9/H/fZ1uhSEZfyJ5F0Rrs9JTIz7IvTCnfdzk/0ASfofD9RQXFL8S7o1nvj5pwHZc5OWa4lX2GMW+yllJAUWq6O2TH7gJ07P3xm4GSytvrcgUVCQWeD2hwfa7CJBVWABfsu1wg75BuFXnH2m29Q/gEfvm93rT53M4filefjGcSnL/wYzaorYJU+nU7Gxh5kTVprN/h905nCR2f2K7//+ffm35/ry193Vz+ury6GhhluunkExWRZwg==

Steps to reproduce

当CustomComponent嵌套在Teleport中,并且Teleport的prop disabled为true时,当我单击“销毁CustomComponent”的按钮后,CustomComponent组件中的onUnmounted生命周期不触发,造成内存泄漏

What is expected?

CustomComponent组件中的onUnmounted生命周期应该触发

What is actually happening?

查看源码后,发现可能是!isTeleportDisabled(props)判断导致的,如下图 微信截图_20230604115912

System Info

No response

Any additional comments?

No response