feat(layout): base-layout 的 RouterView 添加 Transition

This commit is contained in:
严浩
2025-10-22 00:45:28 +08:00
parent 1afb28cb2b
commit 26f3348b28
6 changed files with 770 additions and 699 deletions

View File

@@ -24,7 +24,11 @@ const appStore = useAppStore();
4#GlobalMenu
</div>
<!-- <div>GlobalContent</div> -->
<RouterView />
<router-view v-slot="{ Component }">
<transition name="fade" mode="out-in">
<component :is="Component" />
</transition>
</router-view>
<!-- <div>ThemeDrawer</div> -->
<template #footer>
<div class="bg-red-100/28 dark:bg-red-900/28 text-red-900 dark:text-red-100 h-full">
@@ -38,4 +42,14 @@ const appStore = useAppStore();
#__SCROLL_EL_ID__ {
@include scrollbar;
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.25s ease-in-out;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
}
</style>