<template>
  <div class="large-nav">
           <div class="nav">
        <div class="item" :class="active==0?'item_act':''"  @click="largeScreen">
         
          <img v-if="active==0" src="../assets/img/nav1_act.png" alt="" />
           <img v-else src="../assets/img/nav1.png" alt="" />
          <span>基地总览</span>
        </div>
            <div class="item"  :class="active==1?'item_act':''" @click="largeScreen2">
          <img v-if="active==1" src="../assets/img/nav4_act.png" alt="" />
          <img v-else src="../assets/img/nav4.png" alt="" />
          <span>监控设备</span>
        </div>
          <div class="item"  :class="active==2?'item_act':''" @click="largeScreen3">
            <img v-if="active==2" src="../assets/img/nav2_act.png" alt=""  />
          <img v-else src="../assets/img/nav2.png" alt="" />
          <span>虫情监测</span>
        </div>
        <div class="item"  :class="active==3?'item_act':''" @click="toBackPage">
          <img v-if="active==3" src="../assets/img/nav5_act.png" alt="" />
          <img v-else src="../assets/img/nav5.png" alt="" />
          <span>环境监测</span>
        </div>
    
      
      </div>
  </div>
</template>
<script>
export default {
    props:{
           active: {
                type: Number,
                default:0
            },
    },
  data(){
      return {}
  },
  mounted(){},
  methods:{
     largeScreen() {
      this.$router.push({ path: "/largeScreen" });
    },
     largeScreen2() {
      this.$router.push({ path: "/largeScreen2" });
    },
    largeScreen3() {
      this.$router.push({ path: "/largeScreen3" });
    },
    toBackPage() {
      this.$router.push({ path: "/realTime" });
    },

  },

}
</script>
<style lang="scss">
    .nav {
      // width: 2.5rem;
      position: absolute;
      z-index: 999999;
      left: 50%;
      transform: translate(-50%);
      bottom: 0.17rem;
      display: flex;
      justify-content: space-between;

      .item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin: 0 .2rem;
        cursor: pointer;
        >img {
          width: 1.08rem;
          height: 0.91rem;
        }

        >span {
          font-size: 0.2rem;
          font-family: AlibabaPuHuiTiB;
          font-weight: bold;
          color: #b1eaff;
        }
      } 

      .item_act {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;

        >img {
          width: 1.08rem;
          height: 0.91rem;
        }

        >span {
          font-size: 0.2rem;
          font-family: AlibabaPuHuiTiB;
          font-weight: bold;
          color: #ffffff;
        }
      }
    }
</style>