keep-alive+router-view不生效的原因

如果在子路里面没有调用activated ,

可能:vue3破坏性改版原来的<keep-alive><router-view/></keep-alive>不可使用了

改为

<router-view v-slot="{ Component }">
    <keep-alive>
      <component :is="Component" />
    </keep-alive>
</router-view>

vue-router链接https://router.vuejs.org/zh/guide/migration/#router-view-%E3%80%81-keep-alive-%E5%92%8C-transition

猜你喜欢

转载自blog.csdn.net/weixin_44383533/article/details/129586158