使用 <router-view></router-view>
路径显示正确但是内容却不能显示,也不报错,不知道是哪里的问题?
路由改成这样:
menus.forEach(item => {
var childArr = item.childs;
childArr.forEach(sub => {
routes.push({
path: `@/demos/${sub.entity.componentName}`,
name: sub.entity.name,
component: () => import(`@/demos/${sub.entity.componentName}`)
})
console.log('aaa' + sub.entity.componentName)
})
});
现在不知道哪里的问题,无从下手。
这是菜单:
module.exports = [
{
"entity": {
"id": 1,
"parentMenuId": 0,
"name": "systemManage",
"componentName": "SystemManage",
"alias": "系统管理",
"state": "ENABLE",
"sort": 0,
"value": null,
"type": "NONE",
"discription": "用于系统管理的菜单",
"createUserId": 1
},
"childs": [
{
"entity": {
"id": 3,
"parentMenuId": 1,
"name": "authManage",
"componentName": "AuthManage",
"icon": "el-icon-loading",
"alias": "权限管理",
"state": "ENABLE",
"sort": 0,
"value": "/system/auth",
"type": "LINK",
"discription": "用于权限管理的菜单",
"createUserId": 1
},
"childs": null
},
{
"entity": {
"id": 4,
"parentMenuId": 1,
"name": "roleManage",
"componentName": "RoleManage",
"icon": "el-icon-bell",
"alias": "角色管理",
"state": "ENABLE",
"sort": 1,
"value": "/system/role",
"type": "LINK",
"discription": "用于角色管理的菜单",
"createUserId": 1
}
}
}
]
}
]
如图中圈起的重点,你访问的路由地址应该是
/system/auth
才对