fix: 修复 RouterView 直接嵌套 Transition 的弃用警告

改用 Vue Router 推荐的 slot props 模式,避免未来版本兼容性问题
This commit is contained in:
2026-05-30 15:51:24 +08:00
parent 887756f4ff
commit 97981d5401
+5 -3
View File
@@ -15,9 +15,11 @@ const route = useRoute();
<MyHead /> <MyHead />
</el-header> </el-header>
<el-main class="shell-main"> <el-main class="shell-main">
<Transition name="fade-up" mode="out-in"> <RouterView v-slot="{ Component }">
<RouterView :key="route.fullPath" /> <Transition name="fade-up" mode="out-in">
</Transition> <component :is="Component" :key="route.fullPath" />
</Transition>
</RouterView>
</el-main> </el-main>
<el-footer class="shell-footer"> <el-footer class="shell-footer">
<MyFooter /> <MyFooter />