vue3在使用keep-alive出现切换页面报错

vue-router.esm-bundler.js?f6c4:3295 
        
       TypeError: parentComponent.ctx.deactivate is not a function
    at unmount (runtime-core.esm-bundler.js?9e79:4686)
    at patch (runtime-core.esm-bundler.js?9e79:3664)
    at Object.sharedContext.activate (runtime-core.esm-bundler.js?9e79:1708)
    at processComponent (runtime-core.esm-bundler.js?9e79:4097)
    at patch (runtime-core.esm-bundler.js?9e79:3695)
    at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js?9e79:4310)
    at ReactiveEffect.run (reactivity.esm-bundler.js?0a2b:160)
    at updateComponent (runtime-core.esm-bundler.js?9e79:4171)
    at processComponent (runtime-core.esm-bundler.js?9e79:4104)
    at patch (runtime-core.esm-bundler.js?9e79:3695)

在这里插入图片描述

在网上搜到的bug解释

大佬链接文档

解决办法

在keep-alive、component上设置key进行排序

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐