123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <template>
- <section class="app-main">
- {{ cachedViews }}
- <div class="main-container">
- <router-view v-slot="{ Component, route }">
- <keep-alive :include="[cachedViews]">
- <component :is="Component" :key="route.name" />
- </keep-alive>
- </router-view>
- </div>
- </section>
- </template>
- <script setup lang="ts">
- import { useTagsViewStore } from "@/store";
- const cachedViews = computed(() =>
- useTagsViewStore().cachedViews.concat(["CommonLayout"])
- ); // 缓存页面集合
- </script>
- <style lang="scss" scoped>
- .app-main {
- position: relative;
- width: 100%;
- min-height: calc(100vh - $navbar-height);
- overflow: hidden;
- // background-color: var(--el-bg-color-page);
- background-color: #f5f9ff;
- }
- .hasTagsView .app-main {
- min-height: calc(100vh - $navbar-height - $tags-view-height);
- }
- .fixed-header + .app-main {
- min-height: 100vh;
- padding-top: $navbar-height;
- }
- .hasTagsView .fixed-header + .app-main {
- min-height: 100vh;
- padding-top: $navbar-height + $tags-view-height;
- }
- .layout-mix,
- .layout-top {
- .fixed-header + .app-main {
- padding-top: 0;
- }
- }
- .layout-mix {
- .app-main {
- height: calc(100vh - $navbar-height);
- padding-top: 0;
- overflow-y: auto;
- }
- .hasTagsView .app-main {
- height: calc(100vh - $navbar-height - $tags-view-height);
- min-height: calc(100vh - $navbar-height - $tags-view-height);
- }
- .fixed-header + .app-main {
- min-height: calc(100vh - $navbar-height);
- }
- .hasTagsView .fixed-header + .app-main {
- height: calc(100vh - $navbar-height);
- min-height: calc(100vh - $navbar-height);
- padding-top: $tags-view-height;
- }
- }
- .layout-top {
- .hasTagsView .fixed-header + .app-main {
- padding-top: $tags-view-height;
- }
- }
- .main-container {
- padding: 10px;
- height: calc(100vh - 86px);
- overflow: auto;
- }
- </style>
|