<template>
  <el-container class="main">
    <el-header :style="{ padding: 0 }"> <component :is="cHeader"></component></el-header>
    <el-container>
      <el-aside width="200px" :style="{ 'background-color': '#242f42' }"><component :is="cAside"></component></el-aside>
      <el-main>
        <div class="content-box" :class="{ 'content-collapse': collapse }">
          <el-col :span="24" class="content">
            <transition name="move" mode="out-in">
              <el-row>
                <component :is="cBreadcrumb" :breadcrumbTitle="route.meta.title"></component>
                <el-col :span="24" class="container" :style="{ padding: '10px 0' }"><router-view :style="testInfo"></router-view></el-col>
              </el-row>
            </transition>
            <el-backtop target=".content"></el-backtop>
          </el-col>
        </div>
      </el-main>
    </el-container>
  </el-container>
</template>

<script setup lang="ts">
// 组件
import cHeader from './parts/Header.vue'
import cAside from './parts/Sidebar.vue'
import cBreadcrumb from './parts/breadcrumb.vue'
import { useRoute } from 'vue-router'
import type { Ref } from 'vue'
import { ref } from 'vue'

// 路由
const route = useRoute()
let collapse: Ref<any> = ref(false)
const testInfo: Ref<any> = ref({
  height: '85vh',
  background: '#ffffff',
  'overflow-x': 'hidden',
  'overflow-y': 'auto',
  border: '1px solid #f0f0f0',
  padding: '10px'
})
</script>
<style scoped lang="scss">
.main {
  height: 100vh;
  background-color: #f0f0f0;
  .el-header {
    border-bottom: 1px solid;
  }
  .el-aside {
    height: 93.3vh;
    overflow-x: auto;
    overflow-y: auto;
  }
  .el-main {
    padding: 10px;
  }
}
</style>
