<style lang="less" scoped>
  @import './chead.less';
</style>
<template>
  <div class="chead-wrap">
    <div class="left-item header-title">
      <img class="logo" src="./img/logo.png">
      <span>DEMO管理后台</span>
    </div>
    <div class="right-item">
      <el-dropdown @command="handleCommand" trigger="click">
        <span class="el-dropdown-link">
          个人中心<i class="el-icon-caret-bottom el-icon--right"></i>
        </span>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item command="changepwd" >修改密码</el-dropdown-item>
          <el-dropdown-item command="logout">注销</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </div>
</template>

<script>
  import store from './store'

  export default {
    name: 'chead',
    data () {
      return {
        view: this.$store.state.chead
      }
    },
    props: [],
    beforeCreate () {
      this.$store.registerModule('chead', store)
    },
    created () {
    },
    destroyed () {
      this.$store.unregisterModule('chead')
    },
    methods: {
      handleCommand (command) {
        console.log(command)
      }
    }
  }
</script>
