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

vue側(cè)邊欄動(dòng)態(tài)生成下級(jí)菜單的方法

 更新時(shí)間:2018年09月07日 14:30:02   作者:零食粉碎機(jī)  
今天小編就為大家分享一篇vue側(cè)邊欄動(dòng)態(tài)生成下級(jí)菜單的方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧

循環(huán)傳入的數(shù)據(jù)去生成下級(jí)菜單

<template>
 <div class="headBar">
 <div class="title">
  微商城管理后臺(tái)
 </div>
 <el-menu
  class="el-menu-headBar"
  mode="horizontal"
  @select="handleSelect"
  background-color="#000000"
  text-color="#fff"
  active-text-color="#ffd04b"
  :unique-opened="true"
  :default-active="onRoutes" router>
  <template v-for="item in items" >
  <template v-if="item.subs" >
   <el-submenu :index="item.index">
   <template slot="title" >
    {{item.title}}
   </template>
   <el-menu-item v-for="(subItem,i) in item.subs" :key="i" :index="subItem.index">
    {{ subItem.title }}
   </el-menu-item>
   </el-submenu>
  </template>
  <template v-else>
   <el-menu-item :index="item.index">
   <label>{{ item.title }}</label>
   </el-menu-item>
  </template>
  </template>
 </el-menu>
 </div>
</template>
 
<script>
 export default {
 data() {
  return {
  activeIndex: "1",
  items: [
   {
   icon: 'el-icon-menu',
   index: '1',
   title: '數(shù)據(jù)統(tǒng)計(jì)',
   subs: [
    {
    index: '/monitor',
    title: '客流展示'
    },
    {
    index: '/monitor/device',
    title: '設(shè)備采集'
    },
    {
    index: '/monitor/tv',
    title: '監(jiān)控視頻'
    }
   ]
   },{
   icon: 'el-icon-goods',
   index: '/product',
   title: '商品管理',
   },{
   icon: 'el-icon-goods',
   index: '/category',
   title: '類(lèi)目管理',
   },{
   icon: 'fa fa-cart-arrow-down',
   index: '/order',
   title: '訂單一覽'
   },{
   icon: 'fa fa-user-o',
   index: '/merchant',
   title: '商家信息'
   },{
   icon: 'el-icon-printer',
   index: '9',
   title: '微商城',
   subs:[
    {
    icon: 'el-icon-printer',
    index: '/banner',
    title: 'banner設(shè)置'
    },{
    icon: 'el-icon-printer',
    index: '/decoration',
    title: '首頁(yè)裝修'
    },{
    icon: 'el-icon-printer',
    index: '/message',
    title: '消息設(shè)置'
    }
   ]
   },{
   icon: 'el-icon-printer',
   index: '10',
   title: '線(xiàn)下店',
   subs:[
    {
    icon: 'el-icon-printer',
    index: '/device',
    title: '設(shè)備管理'
    },{
    icon: 'el-icon-printer',
    index: '/advertise',
    title: '廣告管理'
    },{
    icon: 'el-icon-printer',
    index: '/version',
    title: '版本管理'
    }
   ]
   },{
   icon: 'el-icon-printer',
   index: '/largeUI',
   title: '大屏'
   },{
   icon: 'el-icon-printer',
   index: '/coupon',
   title: '優(yōu)惠券'
   }
  ],
  }
 },
 methods: {
  handleSelect(key, keyPath) {
  console.log(key, keyPath);
  }
 },
 computed:{
  onRoutes(){
  return this.$route.path.replace('/','');
  }
 }
 }
</script>
 
<style scoped>
 .el-menu-headBar {
 width: 80%;
 min-width: 950px;
 font-size: 12px;
 border-bottom: 1px #000000;
 }
 
 .headBar {
 width: 100%;
 height: 50px;
 display: flex;
 background-color: #000000;
 }
 
 .title {
 background-color: #ffdb15;
 color: #000;
 height: 100%;
 min-width: 200px;
 width: 200px;
 display: flex;
 justify-content: center;
 align-items: center;
 letter-spacing: 5px;
 font-size: 17px;
 }
</style>

以上這篇vue側(cè)邊欄動(dòng)態(tài)生成下級(jí)菜單的方法就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

  • Vue項(xiàng)目如何配置git忽略文件

    Vue項(xiàng)目如何配置git忽略文件

    這篇文章主要介紹了Vue項(xiàng)目如何配置git忽略文件問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-03-03
  • vue與django集成打包的實(shí)現(xiàn)方法

    vue與django集成打包的實(shí)現(xiàn)方法

    這篇文章主要介紹了vue與django集成打包的實(shí)現(xiàn)方法,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-11-11
  • 解決vue?eslint開(kāi)發(fā)嚴(yán)格模式警告錯(cuò)誤的問(wèn)題

    解決vue?eslint開(kāi)發(fā)嚴(yán)格模式警告錯(cuò)誤的問(wèn)題

    這篇文章主要介紹了解決vue?eslint開(kāi)發(fā)嚴(yán)格模式警告錯(cuò)誤的問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-04-04
  • vue3+vite2中使用svg的方法詳解(親測(cè)可用)

    vue3+vite2中使用svg的方法詳解(親測(cè)可用)

    vue2的時(shí)候使用的是字體圖標(biāo),缺點(diǎn)就是比較單一,到了vue3,相信瀏覽器的性能起來(lái),所以這里記錄一下,下面這篇文章主要給大家介紹了關(guān)于vue3+vite2中使用svg的相關(guān)資料,需要的朋友可以參考下
    2022-08-08
  • vue在IIS服務(wù)器部署后路由無(wú)法跳轉(zhuǎn)

    vue在IIS服務(wù)器部署后路由無(wú)法跳轉(zhuǎn)

    在IIS服務(wù)器上部署Vue項(xiàng)目時(shí),可能會(huì)遇到路由無(wú)法正常跳轉(zhuǎn)的問(wèn)題,解決方法有兩種,下面就來(lái)具體介紹一下解決方法,感興趣的可以了解一下
    2024-10-10
  • Vue3中引入使用vant組件的教程詳解

    Vue3中引入使用vant組件的教程詳解

    Vant是一個(gè)強(qiáng)大的移動(dòng)端組件庫(kù),目前Vant 官方提供了 Vue 2 版本,Vue 3 版本和微信小程序版本,本文主要為大家介紹vue3中的vant組件引入使用的方法,希望對(duì)大家有所幫助
    2023-10-10
  • Vue3.0 響應(yīng)式系統(tǒng)源碼逐行分析講解

    Vue3.0 響應(yīng)式系統(tǒng)源碼逐行分析講解

    這篇文章主要介紹了Vue3.0 響應(yīng)式系統(tǒng)源碼逐行分析講解,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-10-10
  • Vue 動(dòng)態(tài)生成數(shù)據(jù)字段的實(shí)例

    Vue 動(dòng)態(tài)生成數(shù)據(jù)字段的實(shí)例

    這篇文章主要介紹了Vue 動(dòng)態(tài)生成數(shù)據(jù)字段的實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-04-04
  • 如何使用crypto-js對(duì)文件上傳下載進(jìn)行加密處理

    如何使用crypto-js對(duì)文件上傳下載進(jìn)行加密處理

    這篇文章主要介紹了如何使用crypto-js對(duì)文件上傳下載進(jìn)行加密處理方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-05-05
  • Vue使用v-viewer插件實(shí)現(xiàn)圖片預(yù)覽和縮放和旋轉(zhuǎn)等功能(推薦)

    Vue使用v-viewer插件實(shí)現(xiàn)圖片預(yù)覽和縮放和旋轉(zhuǎn)等功能(推薦)

    v-viewer是一個(gè)基于viewerjs封裝的vue圖片預(yù)覽組件,有預(yù)覽縮放拉伸旋轉(zhuǎn)切換拖拽等功能,支持配置化,這篇文章主要介紹了Vue使用v-viewer插件實(shí)現(xiàn)圖片預(yù)覽和縮放和旋轉(zhuǎn)等功能,需要的朋友可以參考下
    2023-02-02

最新評(píng)論

湖北省| 肥乡县| 祥云县| 九台市| 西吉县| 宿迁市| 高唐县| 高密市| 区。| 阿尔山市| 霍山县| 五莲县| 隆回县| 垫江县| 永春县| 宜黄县| 巫溪县| 怀安县| 泸水县| 丘北县| 中山市| 营口市| 山东省| 通许县| 大安市| 兰溪市| 乌审旗| 凌云县| 遵义县| 白朗县| 旬邑县| 阳山县| 吴桥县| 内江市| 辽中县| 沈丘县| 延长县| 清河县| 德化县| 阜南县| 商城县|