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

44 lines
1.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<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);
});
/*** - 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">
<view>闽公网安备 352018502850842 闽ICP备20250520582号 © 2025小题科技All Rights Reserved.</view>
<view>* 数据通过公开渠道获取灵机进行统计分析</view>
</view>
</router-view>
</template>
<style lang="scss" scoped>
.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>