-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Closed
Description
Version
3.2.1
When vue-cli3.x uses routing loading on demand and nested routing, it makes errors when it enters subrouting
Reproduction link
https://segmentfault.com/q/1010000017171899?_ea=5193336
Node and OS info
8.12.0
Steps to reproduce
const router = new Router({
routes: [
{path: '*',name: '',redirect: '/index'},
// 账户资料模块
{
path: '/',
name: '首页',
component:() =>import(/* webpackChunkName: "0" */ "./views/Home.vue"),
children: [
{path: 'index',name: '页面首页',component: () =>import(/* webpackChunkName: "1" */ "./views/Index.vue")},
{path: 'order',name: '订单记录',component: () =>import(/* webpackChunkName: "2" */ "./views/Order.vue")},
{
path: 'assets',
name: '资产',
component: () =>import(/* webpackChunkName: "3" */ "./views/assets/Assets.vue"),
children:[
{path: 'index',name: '资产首页',component: () =>import(/* webpackChunkName: "4" */ "./views/assets/Index.vue")},
{path: 'withdrawal',name: '提现',component: () =>import(/* webpackChunkName: "5" */ "./views/assets/Withdrawal.vue")},
{path: 'record',name: '提现记录',component: () =>import(/* webpackChunkName: "6" */ "./views/assets/Record.vue")},
{path: 'details',name: '账单明细',component: () =>import(/* webpackChunkName: "7" */ "./views/assets/Details.vue")},
{path: 'recordDetails',name: '提现详情',component: () =>import(/* webpackChunkName: "8" */ "./views/assets/RecordDetails.vue")},
]
},
{
path: 'account',
name: '账户中心',
component: () =>import(/* webpackChunkName: "9" */ "./views/account/Account.vue"),
children:[
{path: 'index',name: '账户中心首页',component: () =>import(/* webpackChunkName: "10" */ "./views/account/Index.vue")},
]
},
]
},
]
});
0,1,2,3,4.js all entered the routing normally. Then when I entered the same sub-routing 5 as 4, I loaded 5.js and a vendors105.js and 10~5.js at the same time. But the corresponding routing of 5 also entered normally. Then I visited the same 6.js corresponding routing as 5 and got the error mentioned above.
Why do you load JS like vendors105.js and 105.js?
What is expected?
正常进入子路由
What is actually happening?
无法进入子路由
Metadata
Metadata
Assignees
Labels
No labels