Layout.vue 1.5 KB
<script setup>
import Head from '@/components/head.vue'
import {ref} from"vue"
const list = ref(["首页","课程","笔记","消息","云盘","通讯录","账号管理","班级管理"])
</script>

<template>
  <div class="counter">
    <!-- 封住头部组件 -->
    <Head></Head>
    <div class="banner">
      <!-- 左边部分 -->
      <div class="left">
        <div class="pic">
          <img src="@/static/Avatar.png" alt="" />
        </div>
        <div class="name">XXX</div>
        <div class="cont">
          <div class="li" v-for="item in list" :key="item">{{ item }}</div>
        </div>
        <div class="one"></div>
      </div>
      <!-- 右边二级路由 -->
      <div class="right">
        <!-- 这里是二级路由的出口 -->
        <router-view></router-view>
      </div>
    </div>
  </div>
</template>
<style lang="scss">
.counter {
  .banner {
display: flex;
  
  .left {
    margin: 40px 40px 0;
    width: 15%;
    background-color: #6170c3;
    color: #fff;
    border-radius: 18px;
    .pic {
      margin: 0 auto;
      padding-top: 50px;
      width: 75px;
      height: 75px;
      img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
      }
    }
    .name {
      margin-top: 10px;
      text-align: center;
    }
    .cont {
      margin-top: 20px;
      .li {
        line-height: 50px;
        width: 100%;
        height: 50px;
        padding-left: 30px;
        box-sizing: border-box;
      }
    }
    .one {
      background-color: pink;
    }
  }
  .right{
    width: 70%;
  }
}
}
</style>