2021-08-26 18:49:20 +08:00
|
|
|
<template>
|
2021-09-09 00:08:09 +08:00
|
|
|
<n-layout class="h-full" has-sider>
|
|
|
|
<global-sider v-if="theme.isVerticalNav" :z-index="2" />
|
|
|
|
<global-header v-if="isHorizontalMix" :z-index="2" />
|
|
|
|
<div class="flex-1-hidden flex h-full">
|
|
|
|
<global-sider v-if="isHorizontalMix" class="sider-margin" :z-index="1" />
|
|
|
|
<n-scrollbar class="h-full" :x-scrollable="true">
|
|
|
|
<div class="inline-flex-col-stretch w-full min-h-100vh" :class="{ 'content-padding': isHorizontalMix }">
|
|
|
|
<global-header v-if="!isHorizontalMix" :z-index="1" />
|
|
|
|
<n-layout-content class="flex-auto" :class="{ 'bg-[#f5f7f9]': !theme.darkMode }">
|
|
|
|
<router-view />
|
|
|
|
</n-layout-content>
|
|
|
|
<global-footer />
|
|
|
|
</div>
|
|
|
|
</n-scrollbar>
|
|
|
|
</div>
|
2021-09-01 17:43:25 +08:00
|
|
|
<setting-drawer />
|
2021-08-26 18:49:20 +08:00
|
|
|
</n-layout>
|
|
|
|
</template>
|
|
|
|
|
2021-09-01 17:43:25 +08:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { computed } from 'vue';
|
2021-09-09 00:08:09 +08:00
|
|
|
import { NLayout, NScrollbar, NLayoutContent } from 'naive-ui';
|
|
|
|
import { useThemeStore } from '@/store';
|
|
|
|
import { GlobalSider, GlobalHeader, GlobalFooter, SettingDrawer } from './components';
|
2021-09-01 17:43:25 +08:00
|
|
|
|
2021-09-07 17:03:59 +08:00
|
|
|
const theme = useThemeStore();
|
2021-09-09 00:08:09 +08:00
|
|
|
const isHorizontalMix = computed(() => theme.navStyle.mode === 'horizontal-mix');
|
2021-09-01 17:43:25 +08:00
|
|
|
const headerHeight = computed(() => {
|
2021-09-07 17:03:59 +08:00
|
|
|
const { height } = theme.headerStyle;
|
2021-09-01 17:43:25 +08:00
|
|
|
return `${height}px`;
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
<style scoped>
|
2021-09-09 00:08:09 +08:00
|
|
|
:deep(.n-scrollbar-rail) {
|
|
|
|
z-index: 11;
|
2021-09-01 17:43:25 +08:00
|
|
|
}
|
2021-09-09 00:08:09 +08:00
|
|
|
.sider-margin {
|
|
|
|
margin-top: v-bind(headerHeight);
|
2021-09-01 17:43:25 +08:00
|
|
|
}
|
2021-09-09 00:08:09 +08:00
|
|
|
.content-padding {
|
2021-09-01 17:43:25 +08:00
|
|
|
padding-top: v-bind(headerHeight);
|
|
|
|
}
|
|
|
|
</style>
|