Files
orion-visor/orion-ops-ui/src/layout/page-layout.vue
2023-12-01 17:29:42 +08:00

27 lines
720 B
Vue

<template>
<router-view v-slot="{ Component, route }">
<transition name="fade" mode="out-in" appear>
<!-- 渲染组件 -->
<component :is="Component"
v-if="route.meta.ignoreCache"
:key="route.fullPath" />
<!-- 渲染缓存组件 -->
<keep-alive v-else :include="cacheList">
<component :is="Component" :key="route.fullPath" />
</keep-alive>
</transition>
</router-view>
</template>
<script lang="ts" setup>
import { computed } from 'vue';
import { useTabBarStore } from '@/store';
const tabBarStore = useTabBarStore();
const cacheList = computed(() => tabBarStore.getCacheList);
</script>
<style lang="less" scoped>
</style>