AIManage/src/layout/components/AppMain/index.vue

84 lines
1.8 KiB
Vue

<template>
<section class="app-main">
<el-scrollbar max-height="calc(100vh - 76px)">
<router-view>
<template #default="{ Component, route }">
<transition
enter-active-class="animate__animated animate__fadeIn"
mode="out-in"
>
<keep-alive :include="cachedViews">
<component :is="Component" :key="route.path" />
</keep-alive>
</transition>
</template>
</router-view>
</el-scrollbar>
</section>
</template>
<script setup lang="ts">
import { useTagsViewStore } from "@/store";
const cachedViews = computed(() => useTagsViewStore().cachedViews); // 缓存页面集合
</script>
<style lang="scss" scoped>
.app-main {
position: relative;
width: 100%;
min-height: calc(100vh - 100px);
overflow: hidden;
}
.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;
}
}
</style>