金融产品设计及数字化营销沙盘
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.3 KiB

2 years ago
<template>
1 year ago
<div class="min-h-full"
:class="isIndex ? 'index' : 'body'">
<app-header v-if="!isIndex" />
<app-sidebar v-if="!hideNav && !isIndex"
class="sidebar fixed w-sidebar h-full px-5 overflow-hidden transition-width duration-300 z-40" />
<div class="main min-h-[calc(100vh-85px)] transition-margin duration-300 overflow-auto"
:class="{ 'md:ml-sidebar': !hideNav && !isIndex }">
2 years ago
<app-main />
</div>
</div>
</template>
<script lang="ts">
import { ref, defineComponent, computed, watch } from 'vue';
import { useRoute } from 'vue-router';
import Setting from '@/settings';
2 years ago
import { AppSidebar, AppHeader, AppMain } from './components';
import useResizeHandler from './composables/useResizeHandler';
export default defineComponent({
name: 'Layout',
components: { AppSidebar, AppHeader, AppMain },
setup() {
const route = useRoute();
1 year ago
// 是否是选择关卡页面
const isIndex = computed(() => {
return route.path === '/';
});
// 是否隐藏左侧导航
const hideNav = computed(() => {
return Setting.hideNavPath.includes(route.path);
});
2 years ago
useResizeHandler();
return {
1 year ago
isIndex,
hideNav,
2 years ago
};
},
});
</script>
<style lang="scss" scoped>
.body {
background: url(../assets/images/1.png) 0 0/100% auto no-repeat;
1 year ago
@apply bg-gray-100;
2 years ago
}
</style>