<el-row class="tac g-left">
<el-col
:span="12"
class="g-left-box"
>
<el-menu
:default-active="this.$route.path"
class="el-menu-vertical-demo"
@open="handleOpen"
@close="handleClose"
>
<router-link to="/home">
<el-menu-item index="1">
<span
slot="title"
class="menu-first"
>首页</span>
</el-menu-item>
</router-link>
<el-submenu
v-for="(textList, IndexKey) in navArr"
:key="IndexKey"
:index="IndexKey+2+''"
>
<template slot="title">
<span class="menu-title">{{textList.navName}}</span>
</template>
<template>
<div
v-for="(listVal,listValIndex) in textList.subArr"
:key="listValIndex"
>
<template v-if="listVal.linkUrl !='/bigScreen'">
<router-link :to="listVal.linkUrl">
<el-menu-item
:index="IndexKey+'(-)'+listValIndex+''"
class="menu-li"
>{{listVal.subName}}</el-menu-item>
</router-link>
</template>
<template v-else>
<a href="https://www.baidu.com">
<el-menu-item
:index="IndexKey+'(-)'+listValIndex+''"
class="menu-li"
>{{listVal.subName}}</el-menu-item>
</a>
</template>
</div>
</template>
</el-submenu>
</el-menu>
</el-col>
</el-row>
navArr: [
{'navName': '生产管理','subArr': [
{'subName': '植株', 'linkUrl': '/plant'},
{'subName': '农事', 'linkUrl': '/farming'},
{'subName': '投入品', 'linkUrl': '/Inputs'},
{'subName': '产量', 'linkUrl': '/yield'},
{'subName': '检测', 'linkUrl': '/testing'},
{'subName': '设备控制', 'linkUrl': '/devicectrl'},
]},
{'navName': '数据仓库','subArr': [
{'subName': '大屏', 'linkUrl': '/bigScreen'},
{'subName': '历史', 'linkUrl': '/history'},
{'subName': '明细', 'linkUrl': '/detail'}
]},
{'navName': '系统管理','subArr': [
{'subName': '农场', 'linkUrl': '/farm'},
{'subName': '设备', 'linkUrl': '/equipment'},
{'subName': '账户', 'linkUrl': '/account'},
{'subName': '种植', 'linkUrl': '/archives'}
]}
]
其他多余的东西或者标签,按需增删。