feat: 新增页面缓存

This commit is contained in:
lilinyuan
2024-03-24 23:00:34 +08:00
parent 365c4c9d69
commit 3efca32dbf

View File

@@ -3,10 +3,20 @@
<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>
<component <keep-alive>
:is="Component" <suspense>
:key="route.fullPath" <component v-if="!route.meta.noCache" :is="Component" :key="route.fullPath" />
></component> <template #fallback>
<div>Loading...</div>
</template>
</suspense>
</keep-alive>
<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>