<!--
 * @Author       : yuanrunwei
 * @Date         : 2020-05-18 12:05:37
 * @LastEditors  : yuanrunwei
 * @LastEditTime : 2020-05-18 15:16:54
 * @FilePath     : \ambre-admin-noob\src\components\vAbove\vAbove.vue
-->
<template>
<div class="vAboveCom">
    <div class="avator">
        <el-dropdown trigger="click">
            <div class="name">
                {{name||'无昵称'}}
                <i class="el-icon-caret-bottom" style="color: #00A0E9"></i>
            </div>
            <el-dropdown-menu class="user-dropdown" slot="dropdown">
                <el-dropdown-item divided>
                    <span @click="logout" style="display:block;">退出</span>
                </el-dropdown-item>
            </el-dropdown-menu>
        </el-dropdown>
    </div>
</div>
</template>

<script>
export default {
  data () {
    return {
      headImg: '',
      name
    }
  },
  mounted () {
    this.name = localStorage.getItem('companyName')
  },
  methods: {
    logout () {
      localStorage.clear()
      this.$cookies.removeCookies()
      location.reload()
    }
  }
}
</script>

<style lang="scss" scoped>
@import './vAbove.scss';

.name {
    font-size: 20px;
    float: left;
}
</style>
