初学Vue。在测试的时候报了如下错误,求各位指点
Uncaught RangeError: Maximum call stack size exceeded
at RegExp.exec (<anonymous>)
at RegExp.[Symbol.match] (<anonymous>)
at String.match (<anonymous>)
at matchRoute (vue-router.esm.js?880d:1635)
at match (vue-router.esm.js?880d:1517)
at redirect (vue-router.esm.js?880d:1577)
at _createRoute (vue-router.esm.js?880d:1616)
at match (vue-router.esm.js?880d:1518)
at redirect (vue-router.esm.js?880d:1577)
at _createRoute (vue-router.esm.js?880d:1616)
报错的场景如下:
我在router/index.js中配置了一条路由,代码如下:
{
path:'/permission',
component: Layout,
redirect: '/permission',
children: [{
path: 'permission',
name: 'Permission',
component: () =>import('@/views/permission/index'),
meta: { title: 'Permission', icon: 'permission' }
}]
}
在点击侧边栏跳转时,地址栏自动变为http://127.0.0.1:8010/#/permission/permission,出于好奇,我把后一个permission删除,以http://127.0.0.1:8010/#/permission/访问,就报了上面的错误,请教一下报错原因,以及如何避免。谢谢。
报错截图: