yangfeng
2023-08-01 ebddc02611b0373c1d5bfa342bd781fb5eb82009
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
<template>
  <div class="sales-lead">
    <div class="header-title">{{ headerTitle }}</div>
    <div class="header-user-info">
      <div class="avatar"><el-avatar icon="el-icon-user-solid"></el-avatar></div>
      <el-dropdown @command="handleCommand">
        <div class="el-dropdown-link">用户名<i class="el-icon-arrow-down el-icon--right"></i></div>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item command="logout">退出</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </div>
</template>
 
<script>
export default {
  name: "SalesLead",
  props: {
    headerTitle: String
  },
  data() {
    return {}
  },
  methods: {
    handleCommand(command) {
      console.log(command)
      if (command === "logout") {
        this.$router.push({ path: "/login" })
      }
    }
  }
}
</script>
 
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.sales-lead {
  display: flex;
  height: 55px;
  line-height: 55px;
  background-color: #fff;
  margin-bottom: 10px;
  .header-title {
    margin-left: 16px;
    font-size: 16px;
    color: #475059;
  }
  .header-user-info {
    margin-left: auto;
    margin-right: 20px;
    display: flex;
    .avatar {
      margin-top: 8px;
      margin-right: 10px;
    }
  }
}
</style>