We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vue动态加载路由,后台获取菜单数据在component中路径拼接就找不模块,写死成一个字符串就可以。
`/**
The text was updated successfully, but these errors were encountered:
No branches or pull requests
vue动态加载路由,后台获取菜单数据在component中路径拼接就找不模块,写死成一个字符串就可以。
`/**
*/
export function generaMenu(routes, data) {
data.forEach(item => {
const url = '@/views/system/User'
const menu = {
path: item.path === '#' ? item.name : item.path,
// 这样不行
// component: item.path === '#' ? Layout : () => import(url),
// 而下面这样就可以
component: item.path === '#' ? Layout : () => import('@/views/system/User'),
name: item.name,
meta: item.meta,
children: []
}
if (item.children !== null) {
generaMenu(menu.children, item.children)
}
routes.push(menu)
})
}`
The text was updated successfully, but these errors were encountered: