fix: 修复路由bug

This commit is contained in:
lilinyuan
2024-03-27 17:30:29 +08:00
parent 4eff7d3751
commit 46765952e5

View File

@@ -3,20 +3,24 @@
<router-view v-slot="{ Component, route }"> <router-view v-slot="{ Component, route }">
<transition name="fade-transform" type="transition" appear mode="out-in"> <transition name="fade-transform" type="transition" appear mode="out-in">
<div> <div>
<keep-alive> <template v-if="!route.meta.noCache">
<keep-alive>
<suspense>
<component :is="Component" :key="route.fullPath" />
<template #fallback>
<div>Loading...</div>
</template>
</suspense>
</keep-alive>
</template>
<template v-else>
<suspense> <suspense>
<component v-if="!route.meta.noCache" :is="Component" :key="route.fullPath" /> <component :is="Component" :key="route.fullPath" />
<template #fallback> <template #fallback>
<div>Loading...</div> <div>Loading...</div>
</template> </template>
</suspense> </suspense>
</keep-alive> </template>
<suspense>
<component v-if="route.meta.noCache" :is="Component" :key="route.fullPath" />
<template #fallback>
<div>Loading...</div>
</template>
</suspense>
</div> </div>
</transition> </transition>
</router-view> </router-view>