<template>
  <div class="left">
    <span class="singleButton top_button" v-for="(item,index) in dataArr" :key="item.name" :class="index === 0?'top_button':'middle_button'">
      <span class="little_span role_button" :role_button_code="item.role_button_code"  :class="[{'little_active':currentTabId === item.id}]" @click="unitChange(item)">{{item.name}}</span>
    </span>
  </div>
</template>

<script>
export default {
  name: "LeftTabControl",
  props:{
    dataArr:{

    },
    currentTabId:{

    }
  },
  methods:{
    unitChange(item) {
      this.$emit('update:currentTabId',item.id,item)
    }
  }
}
</script>

<style scoped lang="scss">
.left{
  width:2%;
  padding-top: 70px;
  height:100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  .singleButton{
    cursor: pointer;
    width:34px;
    height:144px;
    border-radius: 4px;
    border: none;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    color: #25a9ee;
    .little_span{
      width:18px;
    }
    .little_active{
      color: #fff;
    }
  }
  .top_button{
    background:url("../../../assets/imgs/住建委.png") no-repeat;
    background-size: 100%;
  }
  .middle_button{
    background:url("../../../assets/imgs/房管局.png") no-repeat;
    background-size: 100%;
  }
  .singleButton:focus,
  .singleButton:hover {
    color: #fff;
  }
}
</style>
