<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 hideFooter = computed(() => 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="!hideFooter">
      <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>
