<router-view> can no longer be used directly inside <transition> or <keep-alive>.
router view>不能直接在<transition>或<keep alive>中使用。keep包router。照着这个提示复制上去。
·
百度翻译:
<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>
更多推荐
已为社区贡献1条内容
所有评论(0)