shikeying
2023-04-07 c192f834c4e092bc7c0f2722c343c25c1be619ab
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
<template>
  <el-tooltip effect="dark" content="退出" placement="bottom">
    <div class="quit" @click="logout()">
      <img class="icon" src="@/assets/images/quit.png" alt="">
    </div>
  </el-tooltip>
</template>
 
<script>
 
export default {
  methods: {
    logout() {
      this.$confirm('确定退出?', '', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$store.dispatch('user/logout').then(() => {
          this.$router.push('/login')
        })
      }).catch(() => {
      })
    }
  }
}
</script>
<style lang="scss"  scoped>
.quit{
  height: 70px;
  display: flex;
  align-items: center;
  .icon{
    width: 25px;
  }
}
</style>