mirror of
https://github.com/xsf0105/vue3-h5-template.git
synced 2025-04-06 04:00:04 +08:00
15 lines
557 B
Vue
15 lines
557 B
Vue
<template>
|
|
<Suspense>
|
|
<template #default>
|
|
<router-view v-slot="{ Component, route }">
|
|
<keep-alive>
|
|
<component :is="Component" v-if="route.meta && route.meta.keepAlive" :key="route.meta.usePathKey ? route.fullPath : undefined" />
|
|
</keep-alive>
|
|
<component :is="Component" v-if="!(route.meta && route.meta.keepAlive)" :key="route.meta.usePathKey ? route.fullPath : undefined" />
|
|
</router-view>
|
|
</template>
|
|
<template #fallback> Loading... </template>
|
|
</Suspense>
|
|
</template>
|
|
<script setup></script>
|