<template>
  <div class="app-wrapper">
    <v-sidebar />
    <v-header />
    <div class="main-container">
      <div class="app-main" :class="{ 'content-collapse': sidebar.collapse }">
        <el-scrollbar>
          <router-view v-slot="{ Component }">
            <transition name="move" mode="out-in">
              <keep-alive>
                <component :is="Component"></component>
              </keep-alive>
            </transition>
          </router-view>
        </el-scrollbar>
      </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">
.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 {
    height: 100vh;
    position: relative;
    width: 100%;
    padding-top: 70px;
    box-sizing: border-box;
    overflow: hidden;
  }
}
</style>
