fix: 修复 RouterView 直接嵌套 Transition 的弃用警告
改用 Vue Router 推荐的 slot props 模式,避免未来版本兼容性问题
This commit is contained in:
+5
-3
@@ -15,9 +15,11 @@ const route = useRoute();
|
||||
<MyHead />
|
||||
</el-header>
|
||||
<el-main class="shell-main">
|
||||
<Transition name="fade-up" mode="out-in">
|
||||
<RouterView :key="route.fullPath" />
|
||||
</Transition>
|
||||
<RouterView v-slot="{ Component }">
|
||||
<Transition name="fade-up" mode="out-in">
|
||||
<component :is="Component" :key="route.fullPath" />
|
||||
</Transition>
|
||||
</RouterView>
|
||||
</el-main>
|
||||
<el-footer class="shell-footer">
|
||||
<MyFooter />
|
||||
|
||||
Reference in New Issue
Block a user