67 lines
1.5 KiB
Vue
Raw Normal View History

2025-03-31 18:24:37 +08:00
<template>
<div class="app-wrapper">
<v-sidebar />
<v-header />
<div class="main-container">
<div class="app-main" :class="{ 'content-collapse': sidebar.collapse }">
2025-04-01 13:52:57 +08:00
<router-view v-slot="{ Component }">
<transition name="move" mode="out-in">
<keep-alive>
<component :is="Component"></component>
</keep-alive>
</transition>
</router-view>
2025-03-31 18:24:37 +08:00
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { useSidebarStore } from "@/store/sidebar";
import vHeader from "@/components/header.vue";
import vSidebar from "@/components/sidebar.vue";
const sidebar = useSidebarStore();
console.log(sidebar);
</script>
<style scoped lang="less">
2025-04-01 18:07:18 +08:00
// @media screen and (max-width: 800px) {
// .main-container {
// margin-left: 0 !important;
// }
// .sidebar-container {
// width: 0 !important;
// }
// .app-wrapper-header {
// width: 100% !important;
// }
// }
2025-03-31 18:24:37 +08:00
.app-wrapper {
position: relative;
width: 100%;
height: 100vh;
background: #f0f2f5;
overflow: hidden;
.main-container {
height: 100vh;
margin-left: 210px;
min-height: 100%;
position: relative;
transition: 0.3s;
background-color: #f2f4fa;
}
.app-main {
2025-04-01 13:52:57 +08:00
// height: 100vh;
height: calc(100vh - 90px);
2025-03-31 18:24:37 +08:00
position: relative;
width: 100%;
2025-04-01 13:52:57 +08:00
display: flex;
flex-direction: column;
// padding-top: 70px;
margin-top: 70px;
2025-03-31 18:24:37 +08:00
box-sizing: border-box;
overflow: hidden;
}
}
</style>