{ path: '/', redirect: '/foo' }, // when come to "/" , I hope go to foo page which is my actural home page { path: '/foo', component: Foo }, { path: '/:pathMatch(.*)', // when not "/ " or not "foo", I hope go to bar page , which is my 404 page . component: Bar }
Reproduction
https://jsfiddle.net/5qv469nr/2/
Steps to reproduce the bug
{ path: '/', redirect: '/foo' }, { path: '/foo', component: Foo }, { path: '/:pathMatch(.*)', component: Bar }
Expected behavior
goto foo
Actual behavior
goto bar
Additional information
{ path: '/', redirect: '/foo' }, // when come to "/" , I hope go to foo page which is my actural home page { path: '/foo', component: Foo }, { path: '/:pathMatch(.*)', // when not "/ " or not "foo", I hope go to bar page , which is my 404 page . component: Bar }
the actural code is like this :
{ path: '/', name: 'home', component: Main, redirect: '/home', meta: { title: '首页' }, children: [ { path: '/home', name: 'home', meta: { title: '首页' }, component: () => import('src/components/home') }, { path: '/:pathMatch(.*)', component: () => import('src/components/error-page/404.vue') } ] }
the code before vue-router@4.3.2 is OK , but wrong when come to vue-router@4.3.3 .
can you fix it @4.3.4 ?