三级导航无法显示,不知道是不是我代码写错了 代码如下:
<!--存在第三级。用v-if判断一下是否存在child.children-->
<el-submenu :index="child.path" v-for="child in item.children" :key="child.path" v-if="child.children">
<template slot="title">{{child.name}}</template>
<el-menu-item v-for="grandson in child.children" :index="grandson.path" v-if="!grandson.hidden">{{grandson.name}}</el-menu-item>
</el-submenu>
路由设置如下:
{
path: '/',
name: '密钥管理', //这是第一层导航
iconCls: 'iconfont icon-miyueguanli',//图标样式class
component: menu,
children: [ //这是第二层导航
{
name: '远程密钥管理',
path: '/remoteKeymanage',
component: resolve => require(['@/components/cipherCode/remoteKeymanage'], resolve),
children:[//这是第三层导航
{
name: '密钥策略',
path: '/strategy',
component: resolve => require(['@/components/cipherCode/strategy'], resolve)
},
就是这边的三级导航内容只是显示二级路由里的页面。不知道怎么改,求帮助。。。