Files
lingji-work-fe/src/layouts/Page.vue

44 lines
1.3 KiB
Vue
Raw Normal View History

2025-06-16 14:42:26 +08:00
<script setup lang="ts">
import { useTabBarStore } from '@/stores';
import { useRoute } from 'vue-router';
const tabBarStore = useTabBarStore();
const cacheList = computed(() => tabBarStore.getCacheList);
/** - <router-view> 上需要设置一个key避免组件复用 */
const route = useRoute();
const routerKey = computed(() => {
return route.path + Math.random();
});
const showFooter = computed(() => {
return !(route.meta && route.meta.hideFooter);
});
2025-06-16 14:42:26 +08:00
/*** - end */
</script>
<template>
<router-view v-slot="{ Component, route }" :key="routerKey">
<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>
<view class="footer" v-if="showFooter">
2025-06-16 14:42:26 +08:00
<view>闽公网安备 352018502850842 闽ICP备20250520582号 © 2025小题科技All Rights Reserved.</view>
<view>* 数据通过公开渠道获取灵机进行统计分析</view>
</view>
</router-view>
</template>
<style lang="scss" scoped>
2025-06-16 14:42:26 +08:00
.footer {
margin: 20px;
width: 98%;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 10px;
font-weight: 400;
color: rgb(var(--color-text-6));
}
</style>