fix: 顶部导航切换后内容区空白
<transition mode="out-in"> 包裹 router-view 时,首次导航后新视图 无法挂载(概览页首次加载正常、切换后所有页面含返回首页均空白, 且无 JS 报错)。改为默认过渡模式 + :key="route.path" 强制按路由 重挂载 + appear 首屏动画;路由改为同步导入简化实现。dev 与生产 构建均验证通过。
This commit is contained in:
@@ -35,8 +35,8 @@ onMounted(() => {
|
||||
</div>
|
||||
|
||||
<router-view v-slot="{ Component }">
|
||||
<transition name="fade-slide" mode="out-in">
|
||||
<component :is="Component" />
|
||||
<transition name="fade-slide" appear>
|
||||
<component :is="Component" :key="route.path" />
|
||||
</transition>
|
||||
</router-view>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user