AppMain.vue 927 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <script setup lang="ts">
  2. import {useTagsViewStore} from "@/store/modules/tagsView";
  3. const tagsViewStore = useTagsViewStore();
  4. </script>
  5. <template>
  6. <section class="app-main">
  7. <router-view v-slot="{Component, route}">
  8. <transition name="router-fade" mode="out-in">
  9. <keep-alive :include="tagsViewStore.cachedViews">
  10. <component :is="Component" :key="route.fullPath" />
  11. </keep-alive>
  12. </transition>
  13. </router-view>
  14. </section>
  15. </template>
  16. <style lang="scss" scoped>
  17. .app-main {
  18. position: relative;
  19. width: 100%;
  20. /* 50= navbar 50 */
  21. min-height: calc(100vh - 50px);
  22. overflow: hidden;
  23. background-color: #f3f6fd;
  24. }
  25. .fixed-header + .app-main {
  26. padding-top: 50px;
  27. }
  28. .hasTagsView {
  29. .app-main {
  30. /* 84 = navbar + tags-view = 50 + 34 */
  31. min-height: calc(100vh - 84px);
  32. }
  33. .fixed-header + .app-main {
  34. min-height: 100vh;
  35. padding-top: 84px;
  36. }
  37. }
  38. </style>