<template>
  <div class="e-nav-menu">
    <div
      :class="value === item[props['key']] ? 'nav-menu-item menu-selected' : 'nav-menu-item'"
      v-for="(item) in activeList"
      :key="item[props['key']]"
      @click="handleClick(item)"
    >
      <svg-icon slot="prefix" icon-class="A_yuanjiaodian" class="icon-left" />
      <div class="nav-item-title">{{ item[props["label"]] }}</div>
      <i class="el-icon-arrow-right icon-right"></i>
    </div>
  </div>
</template>
<script>
export default {
  name: "ENavMenu",
  props: {
    value: {
      type: [String, Number],
      default: () => {
        return 0
      }
    },
    props: {
      type: Object,
      default: () => {
        return {
          label: "label",
          key: "key",
        };
      },
    },
    activeList: {
      type: Array,
      default: () => {
        return [
          {
            label: "项目管理",
            key: "projectOt"
          },
          {
            label: "设备管理",
            key: "projectOt"
          },
        ];
      },
    },
  },
  methods: {
    handleClick(row) {
      this.$emit('input', row[this.props['key']]);
    }
  }
};
</script>
<style scoped lang="scss">
.e-nav-menu {
  width: 150px;
  height: 100%;
  padding-top: 15px;
  border-right: 1px solid #E8E8E8;
  .nav-menu-item {
    width: 100%;
    height: 32px;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    .nav-item-title {
      font-size: 14px;
      font-family: 'Source Han Sans CN';
      font-weight: 300;
      color: #344567;
    }
    .icon-left {
      font-size: 18px;
    }
    .icon-right {
      font-size: 18px
    }
  }
  .menu-selected {
    background: #F4F5F7;
    .nav-item-title {
      color: #1890FF;
    }
  }
}
</style>
