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

84 lines
1.8 KiB
Vue
Raw Normal View History

2024-05-21 01:41:47 +08:00
<template>
<section class="app-main">
2024-05-22 01:03:00 +08:00
<el-scrollbar max-height="calc(100vh - 76px)">
2024-05-21 01:41:47 +08:00
<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>
2024-05-22 01:03:00 +08:00
</el-scrollbar>
2024-05-21 01:41:47 +08:00
</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%;
2024-05-22 01:03:00 +08:00
min-height: calc(100vh - 100px);
overflow: hidden;
2024-05-21 01:41:47 +08:00
}
.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>