use the < router-view > < / router-view >
path to display correctly but the content cannot be displayed and the error is not reported. I don"t know what the problem is.
the route is changed to this:
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)
})
});
now I don"t know where the problem is, and I don"t know how to start.
here is the menu:
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
}
}
}
]
}
]