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 }">
<transition name="fade-transform" type="transition" appear mode="out-in">
<div>
<component
:is="Component"
:key="route.fullPath"
></component>
<keep-alive>
<suspense>
<component v-if="!route.meta.noCache" :is="Component" :key="route.fullPath" />
<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>
</transition>
</router-view>