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.

28 lines
788 B

9 months ago
<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>
9 months ago
</template>
<script lang="ts" setup>
import { ref } from 'vue'
9 months ago
import { useRoute } from 'vue-router'
import settingStore from '@/store/module/setting'
9 months ago
const $route = useRoute()
const useSettingStore = settingStore()
9 months ago
console.log($route)
// 缓存的路由名称列表
const cachedRoutes = ref(['Home']) // 根据路由的 name 控制缓存
useSettingStore.setLogo()
9 months ago
</script>
9 months ago
<style lang="scss" scoped></style>