最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Vue實(shí)現(xiàn)側(cè)邊菜單欄手風(fēng)琴效果實(shí)例代碼

 更新時(shí)間:2018年05月31日 10:17:38   作者:張三無(wú)語(yǔ)  
本文通過(guò)一段簡(jiǎn)單的代碼給大家介紹了基于純vue實(shí)現(xiàn)側(cè)邊菜單欄手風(fēng)琴效果,代碼很簡(jiǎn)單,感興趣的朋友跟隨腳本之家小編一起看看吧

效果圖如下所示:

<template> 
  <div class="asideBox"> 
   <aside> 
    <ul class="asideMenu"> 
     <li v-for="(item,index) in menuList"> 
      <div class="oneMenu" @click="showToggle(item,index)"> 
       <img v-bind:src="item.imgUrl" /> 
       <span>{{item.name}}</span> 
      </div> 
      <ul v-show="item.isSubShow"> 
       <li v-for="subItem in item.subItems"> 
        <div class="oneMenuChild">{{subItem.name}}</div> 
       </li> 
      </ul> 
     </li> 
    </ul> 
   </aside> 
  </div> 
</template> 
export default { 
  data(){ 
   return{ 
    menuList:[ 
     { 
      name:'字符錄入', 
      imgUrl:require('../assets/images/icon-character.png'), 
      isSubShow:false, 
      subItems:[ 
       { 
        name:'字符錄入' 
       }, 
       { 
        name:'白話文錄入' 
       }, 
       { 
        name:'文言文錄入' 
       }, 
       { 
        name:'小寫(xiě)數(shù)字錄入' 
       } 
      ] 
     }, 
     { 
      name:'票據(jù)數(shù)據(jù)錄入', 
      imgUrl:require('../assets/images/icon-bill.png'), 
      isSubShow:false, 
      subItems:[ 
       { 
        name:'票據(jù)錄入' 
       }, 
       { 
        name:'翻打傳票' 
       }, 
      ] 
     }, 
     { 
      name:'交易碼錄入', 
      imgUrl:require('../assets/images/icon-transaction.png'), 
      isSubShow:false, 
      subItems:[ 
       { 
        name:'交易碼錄入' 
       }, 
       { 
        name:'交易名稱(chēng)錄入' 
       }, 
      ] 
     }, 
     { 
      name:'操作碼錄入', 
      imgUrl:require('../assets/images/icon-operation.png'), 
      isSubShow:false, 
      subItems:[ 
       { 
        name:'操作碼錄入' 
       }, 
       { 
        name:'操作名稱(chēng)錄入' 
       }, 
      ] 
     }, 
     { 
      name:'票據(jù)學(xué)習(xí)', 
      imgUrl:require('../assets/images/icon-billearn.png'), 
      isSubShow:false, 
      subItems:[ 
      ] 
     }, 
     { 
      name:'內(nèi)部憑證學(xué)習(xí)', 
      imgUrl:require('../assets/images/icon-voucher.png'), 
      isSubShow:false, 
      subItems:[ 
      ] 
     }, 
     { 
      name:'現(xiàn)金管理學(xué)習(xí)', 
      imgUrl:require('../assets/images/icon-cash.png'), 
      isSubShow:false, 
      subItems:[ 
      ] 
     }, 
    ] 
   } 
  }, 
  methods:{ 
   // 點(diǎn)擊展開(kāi)折疊菜單事件 
   showToggle:function(item,ind){ 
    this.menuList.forEach(i => { 
     // 判斷如果數(shù)據(jù)中的menuList[i]的show屬性不等于當(dāng)前數(shù)據(jù)的isSubShow屬性那么menuList[i]等于false 
     if (i.isSubShow !== this.menuList[ind].isSubShow) { 
      i.isSubShow = false; 
     } 
    }); 
    item.isSubShow = !item.isSubShow; 
    console.log(item.name) 
   }, 
  } 
 } 
<style lang="scss" scoped> 
 $menuBackColor:#f1f1f1; 
 $menuListH2:#8fbfef; 
 .asideBox{ 
  height: 100%; 
  width: 300px; 
  aside{ 
   background: $menuBackColor; 
   height: 100%; 
   .asideMenu{ 
    .oneMenu{ 
     height: 50px; 
     line-height: 50px; 
     font-size: 18px; 
     font-weight: normal; 
     color: #ffffff; 
     background: $menuListH2 url("../assets/images/icon-open.png") no-repeat 280px center; 
     border-bottom: 1px solid #669cd9; 
     img{ 
      width: 20px; 
      height: 20px; 
      margin: 15px 16px 15px 20px; 
      vertical-align: top; 
     } 
    } 
    .oneMenuChild{ 
     padding: 0 20px 0 60px; 
     height: 40px; 
     line-height: 40px; 
     background: $menuBackColor; 
     border-bottom: 1px solid #ffffff; 
     color: #454343; 
     font-size: 18px; 
    } 
   } 
  } 
 } 
</style> 

總結(jié)

以上所述是小編給大家介紹的Vue實(shí)現(xiàn)側(cè)邊菜單欄手風(fēng)琴效果實(shí)例代碼,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論

普兰县| 丰原市| 芜湖市| 铜川市| 偏关县| 迁西县| 库车县| 沐川县| 璧山县| 安宁市| 巨野县| 固阳县| 神木县| 二手房| 广安市| 祁东县| 炎陵县| 教育| 临沧市| 枣强县| 万山特区| 广东省| 莫力| 中牟县| 麦盖提县| 淮南市| 巧家县| 盖州市| 武功县| 政和县| 荣昌县| 彩票| 寻乌县| 卢湾区| 耒阳市| 云南省| 卢龙县| 霍林郭勒市| 五大连池市| 前郭尔| 黄浦区|