TypeError: parentComponent.ctx.deactivate is not a function

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)

TypeError: parentComponent.ctx.deactivate is not a function_第1张图片

在网上搜到的bug解释

大佬链接文档

解决办法

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

你可能感兴趣的:(Vue3,keep-alive,vue.js,前端)