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

<script setup>
import { useTagsViewStore } from "@/store/modules/index";

const route = useRoute();
const tagsViewStore = useTagsViewStore();

tagsViewStore.addCachedView(route);
const cachedViews = computed(() => {
  return tagsViewStore.cachedViews;
});
</script>

<style lang="scss">
// fix css style bug in open el-dialog
.el-popup-parent--hidden {
  .fixed-header {
    padding-right: 17px;
  }
}
</style>
