<template>
  <div class="head-box">
      <div class="">{{$route.meta.title}}</div>
      <div class="">
        欢迎您，{{name||"Super Admin"}}
        <el-button @click="signOut" class="button" size="medium" type="danger" plain>退出</el-button>
      </div>
  </div>
</template>

<script>
  export default {
    data(){
      return{
        name:'',
      }
    },
    mounted() {
      this.name = localStorage.getItem('userName')
    },
    methods:{
      signOut(){
        localStorage.clear()
        this.$router.push('/login')
      },
    },
  }
</script>

<style scoped lang="scss">
  .head-box{
    box-sizing: border-box;
    width: 100%;
    height: 60px;
    background-color: #fff;
    border-bottom: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    padding: 0 30px;
    .button{
      margin-left: 30px;
    }
  }
</style>
