AppMain.vue 923 字节
Newer Older
1 2 3 4 5 6
<script setup lang="ts">
import { useTagsViewStore } from '@/store/modules/tagsView';

const tagsViewStore = useTagsViewStore();
</script>

.  
有来技术 已提交
7
<template>
郝先瑞 已提交
8 9 10
  <section class="app-main">
    <router-view v-slot="{ Component, route }">
      <transition name="router-fade" mode="out-in">
11
        <keep-alive :include="tagsViewStore.cachedViews">
郝先瑞 已提交
12 13 14 15 16
          <component :is="Component" :key="route.fullPath" />
        </keep-alive>
      </transition>
    </router-view>
  </section>
.  
有来技术 已提交
17 18
</template>

19
<style lang="scss" scoped>
.  
有来技术 已提交
20
.app-main {
郝先瑞 已提交
21 22 23 24 25
  /* 50= navbar  50  */
  min-height: calc(100vh - 50px);
  width: 100%;
  position: relative;
  overflow: hidden;
26
  background-color: var(--el-bg-color-page);
.  
有来技术 已提交
27
}
28

郝先瑞 已提交
29
.fixed-header + .app-main {
郝先瑞 已提交
30
  padding-top: 50px;
.  
有来技术 已提交
31
}
32 33

.hasTagsView {
郝先瑞 已提交
34 35 36 37 38 39 40 41
  .app-main {
    /* 84 = navbar + tags-view = 50 + 34 */
    min-height: calc(100vh - 84px);
  }

  .fixed-header + .app-main {
    padding-top: 84px;
  }
42
}
.  
有来技术 已提交
43
</style>