<script setup lang="ts">
 import { computed } from "vue"
import { useTagsViewStore } from '@/store/modules/tagsView';
import { useRoute, } from 'vue-router';

const tagsViewStore = useTagsViewStore();
 
const router = useRoute();
const routeKey = computed(() => router.path + Math.random());
</script>

<template>
  <section class="app-main">
    <router-view v-slot="{ Component, route }" :key="routeKey">
      <transition name="router-fade" mode="out-in">
        <keep-alive :include="tagsViewStore.cachedViews">
          <component :is="Component" :key="route.fullPath" />
        </keep-alive>
      </transition>
    </router-view>
  </section>
</template>

<style lang="scss" scoped>
@use "@/styles/variables.module.scss" as *;
.app-main {
  min-height: calc(100vh - $layout-header-height - $locationbar-height);
  width: 100%;
  position: relative;
  overflow: hidden;
  background-color: #ffffff;
  box-sizing: border-box;
}
</style>
