element ui的三级导航菜单,点击任意一个第二级导航时,所有的三级导航都会被展开如图,当我点击二级菜单如摄像头时,wifi和摄像头的子菜单都会同时展开或关闭代码部分:<template v-for="item in items"> <el-submenu :index="item.index"> <template slot="title"> <img :src="item.icon" alt="">{{ item.title }} </template> <template v-for="(subItem,i) in item.subs" > <template v-if="subItem.sonSubs"> <el-submenu :index="subItem.index"> <template slot="title"> <img :src="'../../../static/img/'+subItem.mark+'.svg'" alt="">{{ subItem.title }} </template> <el-menu-item v-for="(sonSubItem,r) in subItem.sonSubs" :index="sonSubItem.index"> <img :src="'../../../static/img/'+sonSubItem.mark+'.svg'" alt="">{{sonSubItem.title}} </el-menu-item> </el-submenu> </template> </template> </el-submenu> </template>
添加回答
举报
0/150
提交
取消