mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-23 07:41:53 +08:00
修复路由懒加载报错问题
This commit is contained in:
parent
aae1825697
commit
da5c1328be
@ -33,23 +33,23 @@ export const constantRoutes = [
|
||||
children: [
|
||||
{
|
||||
path: '/redirect/:path(.*)',
|
||||
component: () => import('@/views/redirect')
|
||||
component: (resolve) => require(['@/views/redirect'], resolve)
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
component: () => import('@/views/login'),
|
||||
component: (resolve) => require(['@/views/login'], resolve),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/404',
|
||||
component: () => import('@/views/error/404'),
|
||||
component: (resolve) => require(['@/views/error/404'], resolve),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/401',
|
||||
component: () => import('@/views/error/401'),
|
||||
component: (resolve) => require(['@/views/error/401'], resolve),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
@ -59,7 +59,7 @@ export const constantRoutes = [
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
component: () => import('@/views/index'),
|
||||
component: (resolve) => require(['@/views/index'], resolve),
|
||||
name: '首页',
|
||||
meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true }
|
||||
}
|
||||
@ -73,7 +73,7 @@ export const constantRoutes = [
|
||||
children: [
|
||||
{
|
||||
path: 'profile',
|
||||
component: () => import('@/views/system/user/profile/index'),
|
||||
component: (resolve) => require(['@/views/system/user/profile/index'], resolve),
|
||||
name: 'Profile',
|
||||
meta: { title: '个人中心', icon: 'user' }
|
||||
}
|
||||
@ -86,7 +86,7 @@ export const constantRoutes = [
|
||||
children: [
|
||||
{
|
||||
path: 'type/data/:dictId(\\d+)',
|
||||
component: () => import('@/views/system/dict/data'),
|
||||
component: (resolve) => require(['@/views/system/dict/data'], resolve),
|
||||
name: 'Data',
|
||||
meta: { title: '字典数据', icon: '' }
|
||||
}
|
||||
@ -99,7 +99,7 @@ export const constantRoutes = [
|
||||
children: [
|
||||
{
|
||||
path: 'log',
|
||||
component: () => import('@/views/monitor/job/log'),
|
||||
component: (resolve) => require(['@/views/monitor/job/log'], resolve),
|
||||
name: 'JobLog',
|
||||
meta: { title: '调度日志' }
|
||||
}
|
||||
@ -112,7 +112,7 @@ export const constantRoutes = [
|
||||
children: [
|
||||
{
|
||||
path: 'edit',
|
||||
component: () => import('@/views/tool/gen/editTable'),
|
||||
component: (resolve) => require(['@/views/tool/gen/editTable'], resolve),
|
||||
name: 'GenEdit',
|
||||
meta: { title: '修改生成配置' }
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ function filterAsyncRouter(asyncRouterMap) {
|
||||
}
|
||||
|
||||
export const loadView = (view) => { // 路由懒加载
|
||||
return () => import(`@/views/${view}`)
|
||||
return (resolve) => require([`@/views/${view}`], resolve)
|
||||
}
|
||||
|
||||
export default permission
|
||||
|
Loading…
Reference in New Issue
Block a user