<template>
  <div id="pageLeft">
    <div class="topContainer">
      <div class="logoDiv">
        <img :src="logoUrl" class="logoImg" />
      </div>
      <div class="middDiv">
        <i class="el-icon-fa-bars fa fa-bars"></i>
      </div>
    </div>
    <div class="menuDiv">
      <el-menu
        text-color="#fff"
        active-text-color="#ffd04b"
        background-color="#364150"
        router
      >
        <el-menu-item-group v-for="menu in menus" :key="menu.id">
          <template slot="title">
            <span v-text="menu.name"></span>
          </template>
          <leftMenu
            :menu="subMenu"
            v-for="subMenu in menu.children"
            :key="subMenu.id"
            :index="subMenu.id"
          ></leftMenu>
        </el-menu-item-group>
      </el-menu>
    </div>
  </div>
</template>
<script>
import { mapState } from "vuex";
import leftMenu from "./leftMenu";
export default {
  props: [],
  data() {
    return {
      logoUrl: require("@/assets/images/logo.png"),
    };
  },
  computed: {
    ...mapState(["menus"]),
  },
  methods: {},
  created() {},

  mounted() {},
  components: {
    leftMenu,
  },
};
</script>

<style scoped>
#pageLeft {
  width: 235px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.topContainer {
  background: #2b3643;
  height: 50px;
  display: flex;
  flex-direction: row;
  align-items: center;
}

.menuDiv {
  flex: 1;
  background: #364150;
  overflow: auto;
}

.logoImg {
  height: 18px;
  margin-left: 20px;
}

.el-icon-fa-bars {
  font-family: FontAwesome !important;
  font-size: inherit;
  font-style: normal;
  font-weight: 400;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  vertical-align: baseline;
  display: inline-block;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #ffffff;
  margin-left: 88px;
  cursor: pointer;
}

.logoDiv {
  flex: 1;
}

.middDiv {
  flex: 1;
}

.el-menu-item-group__title span {
  font-size: 14px !important;
  color: #68707b;
  font-weight: bold;
}
</style>

