ColorWhiteDeveloper
2022-09-19 0cf2375b6de4c9b65a10aa1c9d4cef9bb5936fe1
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<template>
  <!-- 头部 -->
  <el-header>
      <!-- 右侧菜单 -->
      <div class="header-title">
        <div class="bell">
          <el-icon class="el-icon-bell" style="color: white"></el-icon>
        </div>
        <div class="userinfo">
          <div class="avatar"></div>
          <span class="username">admin</span>
        </div>
        <div class="loginout" @click="loginout">退出登录</div>
      </div>
    </el-header>
</template>
 
<script>
export default {
  data() {
    return {
      opened: false,
    };
  },
  methods:{
    loginout(){
      this.$router.push({path:"/login"})
    }
  }
};
</script>
 
<style lang="scss" >
.el-header {
  background-color: #071a38;
  color: #333;
  text-align: center;
  line-height: 60px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  width: 100%;
  .header-title {
    display: flex;
    align-items: center;
    width: 280px;
    justify-content: space-evenly;
    .bell {
      background-color: #00d1fa;
      width: 25px;
      height: 25px;
      border-radius: 5px;
      text-align: center;
      line-height: 25px;
    }
    .userinfo {
      width: 100xp;
      display: flex;
      align-items: center;
      .avatar {
        width: 25px;
        height: 25px;
        border-radius: 50%;
        background-image: url("@/assets/imgs/user/default-avatar.jpg");
        background-size: cover;
      }
      .username {
        margin: 0 5px;
        color: #22d3eb;
        font-size: 14px;
      }
    }
    .loginout {
      color: #22d3eb;
      font-size: 14px;
    }
  }
}
</style>