报错代码
{
path: '/:pathMatch(.*)*', //‘/:matchAll(.*)*’
redirect: { name: 'home' }
}
查阅相关报错解答
没有找到既针对我的代码又针对我的报错的解释和解决方案,我做了如下测试:
使用/:pathMatch(.*)*,但更改rediret部分:不会报错,页面跳转到home视图,但url不会随之更改。
{
path: '/:pathMatch(.*)*',
name: 'home',
component: Home
}
使用redirect,但修改path为确定路径:不会报错,页面跳转且url修改(redirect完美执行)
{
path: '/manage',
redirect: { name: 'manage' }
},
结论:redirect和/:pathMatch(.*)*同时使用时会有一些错误,具体的原理不太清楚,后续会继续查阅文档解决。