QYF-GitLab1
2025-03-03 f5eb93a15ff74eeb8b6b307e3a38b95319c084e1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<script setup lang="ts">
import { ref } from 'vue';
import Header from './layout/Header.vue';
import TreeMenu from './components/TreeMenu.vue';
 
const menuItem = ref('/')
 
const handMenu = (key: string) => {
  menuItem.value = key;
};
 
</script>
 
<template>
  <div class="common-layout">
    <el-container>
      <el-header height="60px">
        <Header @selectMenu="handMenu"/>
      </el-header>
      <el-container>
        <el-aside width="240px">
          <TreeMenu :menuItem="menuItem"/>
        </el-aside>
        <el-main>
          <RouterView />
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
 
<style lang="less">
.common-layout {
  height: 100vh;
  .el-container {
    height: 100%;
  }
  .el-header {
    background-color: #fff;
    color: #333;
    line-height: 60px;
    border-bottom: 1px solid #eee;
  }
  .el-aside {
    background-color: #fff;
    border-right: 1px solid #eee;
  }
  .el-main {
    background-color: #f5f7fa;
  }
}
</style>