<el-menu
router
:default-openeds="defaultOpened"
default-active="$route.path"
active-text-color="#FEB307"
>
<el-submenu v-for="tab in menus" :index="tab.url" :key="tab.url">
<template slot="title" class="title">
<i :class="['iconfont',tab.icon]"></i>
<span>{{tab.title}}</span>
</template>
<el-menu-item v-for="(item,$index) in tab.child" :index="item.path" :key="$index">
<i class="iconfont icon-dian"></i>
<span>{{item.lable}}</span>
</el-menu-item>
</el-submenu>
</el-menu>
menus: [
{
title: '我是卖方',
url: 'seller',
icon: 'icon-maichu1',
child: [
{
lable: '发布票据',
path: '/postBill'
},
{
lable: '我的票据',
path: '/myBill'
},
{
lable: '卖方订单',
path: '/sellerOrder'
}
]
},
{
title: '我是买方',
url: 'buyer',
icon: 'icon-mairu1',
child: [
{
lable: '我的竞价',
path: ''
},
{
lable: '买方订单',
path: ''
},
{
lable: '发布买票',
path: ''
}
]
},
{
title: '企业管理',
url: 'enterprise',
icon: 'icon-qiyeguanli',
child: [
{
lable: '企业信息',
path: ''
},
{
lable: '执剑人账户',
path: ''
},
{
lable: '汇票豆账户',
path: ''
},
{
lable: '安全中心',
path: ''
},
{
lable: '消息中心',
path: ''
}
]
}
]
按需求默认全部菜单都打开(已实现),点击关闭当前菜单,再点击打开当前菜单,点击右边空白区域不收缩或打开菜单
而现在的问题是:
1、点击如:我是买方,三个类的菜单都会被收缩,再点击只会打开当前菜单;
2、点击右边空白区域也会全部收缩。
哪位大佬知道怎么解决吗?
这个大概是element-ui升级的问题,看看你的element-ui是否是2.4.10,如果是,请降级为2.4.9,这样既可解决部分问题