<template>
  <d2-container class="ct">
    <template slot="header">header</template>
    <div class="test">
      <div class="tac">
        <el-menu
          :default-active="index"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
        >
          <el-menu-item index="1" @click="handleMenuChange('1')">
            <span class="circle"><d2-icon-svg name="mail"/></span>
            <span slot="title">通讯录管理</span>
          </el-menu-item>
          <el-menu-item index="2" @click="handleMenuChange('2')">
            <span class="circle"><d2-icon-svg name="counter"/></span>
            <span slot="title">柜组管理</span>
          </el-menu-item>
          <el-menu-item index="3" @click="handleMenuChange('3')">
            <span class="circle"><d2-icon-svg name="store"/></span>
            <span slot="title">门店管理</span>
          </el-menu-item>
        </el-menu>
      </div>
    </div>
    <div class="content">
      <mail v-if="index == '1'"></mail>
      <store v-if="index == '2'"></store>
      <counter v-if="index == '3'"></counter>
    </div>
  </d2-container>
</template>

<script>
import Mail from "./mail";
import Store from "./store";
import Counter from "./counter";
export default {
  components: {
    Mail,
    Store,
    Counter
  },
  data () {
    return {
      index: '1'
    }
  },
  methods: {
    handleClose () {},
    handleOpen (index) {
    },
    handleMenuChange (index) {
      this.index = index    
    }
  } 
}
</script>
<style></style>
<style scoped>
.test {
  /* border: 2px solid red; */
  min-height: 100%;
  /* box-shadow: 0px 2px 4px 0px rgba(221, 221, 221, 1); */
  display: flex;
}
.ct >>> .d2-container-full__body {
  display: flex;
  justify-content: space-between;
  padding: 0 !important;
}
.tac {
  width:180px;
  height: 100%;
  /* box-shadow: 0px 4px 0px 0px rgba(221, 221, 221, 1); */
}
.tac >>> .el-menu {
  border-right: none;
}
.content {
  flex: 6;
}
.circle {
  display: inline-block;
  width: 24px;
  height: 24px;
  background:rgba(255,255,255,1);
  box-shadow: 0px 1px 2px 0px rgba(78,89,199,1);
  border-radius: 50%;
  line-height: 24px;
  text-align: center;
  margin-right: 12px;
}
.theme-d2 .el-menu-item svg, .theme-d2 .el-submenu__title svg {
  margin-right: 0;
}
</style>