VUE NavBar 资源分享~~~~

**

vue的侧边工具栏,万年伸手党的良心发现

VueBar

<template>
  <div class="NavBar">
    <div class="NavBar-row" v-for="(item,index) in NavBarListData" :key="index" 
    @mouseover="item.showChildren = true"
    @mouseout="item.showChildren = false">
      <div class="row-content">
        <div class="row-title">
          <div class="row-title-icon"></div>
        </div>
        <div class="row-main">
          <div class="row-title-text">{{item.titleText}}</div>
          <div class="row-num">{{item.num}}</div>
        </div>
        <!-- <transition name="el-zoom-in-right" :duration="{ enter: 500, leave: 80 }"> -->
          <div class="NavBar-row-chidren" v-if="item.showChildren">
            <div class="chidren-row" v-for="(citem,cindex) in item.children" :key="cindex">
              <div class="chidren-row-select">
                <el-checkbox v-model="citem.select"></el-checkbox>
              </div>
              <div class="chidren-row-text">
                {{citem.name}}
              </div>
            </div>
          </div>
        <!-- </transition> -->
      </div>
    </div>
  </div>
</template>

<script>
import VueBaseWidget from "hugegis/VueBaseWidget";

export default {
  name: "NavBar",
  mixins: [VueBaseWidget],
  components: {

  },
  data() {
    return {
      NavBarListData:[
        {
          titleIcon:"",
          titleText:"报警事件",
          num:"282",
          showChildren:false,
          children:[{
            select:true,
            name:"自控报警"
          },{
            select:true,
            name:"安防报警"
          }]
        },
        {
          titleIcon:"",
          titleText:"人员总览",
          num:"282",
          showChildren:false,
          children:[]
        },
        {
          titleIcon:"",
          titleText:"厂区车辆",
          num:"282",
          showChildren:false,
          children:[]
        },
        {
          titleIcon:"",
          titleText:"安防监控",
          num:"282",
          showChildren:false,
          children:[]
        },
        {
          titleIcon:"",
          titleText:"自控系统",
          num:"282",
          showChildren:false,
          children:[]
        },
        {
          titleIcon:"",
          titleText:"智能配电",
          num:"282",
          showChildren:false,
          children:[]
        },
        {
          titleIcon:"",
          titleText:"管线总览",
          num:"282",
          showChildren:false,
          children:[]
        },
        {
          titleIcon:"",
          titleText:"资源管理",
          num:"282",
          showChildren:false,
          children:[]
        },
        {
          titleIcon:"",
          titleText:"主要指标",
          num:"282",
          showChildren:false,
          children:[]
        }
      ]
    }
  },
  computed: {

  },
  watch:{

  },
  methods: {

  },
  created() {},
  mounted() {

  }
};
</script>

<style scoped>
.NavBar{
  background: rgba(23,52,102,0.90);
  border: 1px solid #136AE9;
  border-radius: 10px;
  position: fixed;
  right: 30px;
  top: 100px;
  width: 336px;
  height: auto;
  color: white;
  border-radius: 10px;
  padding: 15px 0;
}
.NavBar-row{
  padding: 0 40px; font-size: 18px;
  cursor: pointer;
  position: relative;
}
.NavBar-row:hover{
  background: #0d2550;
}
.row-content{
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.row-title{
  display: flex;
  align-items: center;
}
.row-title-icon{
  width: 40px; height: 40px; background-color: black;
  margin-right: 20px;
}
.row-num{
  color:greenyellow;
}
.row-main{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  width: calc(100% - 60px);
  border-bottom: 1px solid #1D4C95;
}
.NavBar-row:nth-last-child(1) .row-main{
  border-bottom: none;
}
.NavBar-row-chidren{
  position: absolute;
  opacity: 0.8;
  background: #173466;
  border: 1px solid #2863C8;
  min-width: 160px; right: 100%;
  padding: 10px 0;
  top: 0;
}
.chidren-row{
  display: flex; justify-content: start; align-items: center; padding: 0 20px; font-size: 16px;
}
.chidren-row-text{
  padding: 10px 0;
  border-bottom: 1px solid #1D4C95;
  width: calc(100% - 47px); text-align: center
}
.chidren-row:nth-last-child(1) .chidren-row-text{
  border-bottom: none;
}
.chidren-row-select{
  margin-right: 20px;
}
</style>

拿走不要客气。~~~~

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值