You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

27 lines
788 B

<template>
<!-- <section class="app-main">
<transition name="fade-transform" mode="out-in">
<router-view :key="$route.path" />
</transition>
</section> -->
<!-- <router-view></router-view> -->
<router-view v-slot="{ Component }">
<keep-alive :include="cachedRoutes">
<component :is="Component"></component>
</keep-alive>
</router-view>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { useRoute } from 'vue-router'
import settingStore from '@/store/module/setting'
const $route = useRoute()
const useSettingStore = settingStore()
console.log($route)
// 缓存的路由名称列表
const cachedRoutes = ref(['Home']) // 根据路由的 name 控制缓存
useSettingStore.setLogo()
</script>
<style lang="scss" scoped></style>