百度翻译:
<router view>不能直接在<transition>或<keep alive>中使用。
改用插槽道具:
运行环境:
"vue": "^3.2.8",
"vue-router": "^4.0.13"
触发警告代码:
<keep-alive>
<router-view name="p2">
</router-view>
</keep-alive>
keep包router
照着这个提示复制上去
<router-view name="p2" v-slot="{ Component }">
<keep-alive include="Home,News">
<component class="view" :is="Component" />
</keep-alive>
</router-view>