Skip to content

调用$destroy后,组件生命周期出现异常。 #6961

@JacBian

Description

@JacBian

Version

2.5.2

Reproduction link

https://github.com/Jack-93/vue-destroy-

Steps to reproduce

1、打开a,b选项卡
2、关闭一个,然后重新打开
3、切换tab选项卡,在vuetools中看到手动destroy的组件每次都会重新生成。

What is expected?

手动destroy后的组件,再次重复打开,不会反复create

What is actually happening?

手动destroy后的组件,再次重复打开,反复create


例子主要涉及几个技术点,
使用了keep-alive缓存组件,
通过router-view动态展示子组件
在点关闭时,手动destroy了router-view的当前组件,然后再次打开组件,或者切换tab,手动destroy过的组件每次都会create

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions