this is a reported error:
menu.js :
module.export = [{
name: "cc-Box Module",
id:"crossChexBox",
sub: [{
name: "device ",
componentName: "DeviceStatus"
}, {
name: "user ",
componentName: "UserStatus"
}]
},{
name: "websiteIcon Module",
id:"icon",
sub:[{
name: "anviz cn-icon",
componentName:"AnvizCnIcon"
}, {
name: "anviz en-icon",
componentName: "AnvizEnIcon"
}, {
name: "u-tec icon",
componentName: "UtecEnIcon"
}, {
name: "box icon",
componentName: "BoxEnIcon"
}, {
name: " icon",
componentName:"CCEnIcon"
}]
}]
iterate through this data set in vue-router:
import menus from "@/config/menu"
var routes = [];
menus.forEach((item) => {
item.sub.forEach((sub) => {
routes.push({
path: `/${sub.componentName}`,
name: sub.componentName,
component: () => import(`@/components/${sub.componentName}`)
})
})
})
compiling does not report an error, but the browser reports such an error that the page cannot be displayed.
what is wrong with it? Thank you!