mirror of
https://github.com/youzan/vant.git
synced 2025-10-17 16:44:21 +00:00
fix(cli): vue-router catchAll usage
This commit is contained in:
@@ -47,12 +47,14 @@ function getRoutes() {
|
||||
|
||||
if (locales) {
|
||||
routes.push({
|
||||
path: '/:catchAll(.*)',
|
||||
name: 'notFound',
|
||||
path: '/:path(.*)+',
|
||||
redirect: (route) => `/${getLangFromRoute(route)}/`,
|
||||
});
|
||||
} else {
|
||||
routes.push({
|
||||
path: '/:catchAll(.*)',
|
||||
name: 'notFound',
|
||||
path: '/:path(.*)+',
|
||||
redirect: '/',
|
||||
});
|
||||
}
|
||||
|
@@ -28,7 +28,8 @@ function getRoutes() {
|
||||
|
||||
if (langs.length) {
|
||||
routes.push({
|
||||
path: '/:catchAll(.*)',
|
||||
name: 'NotFound',
|
||||
path: '/:path(.*)+',
|
||||
redirect: (route) => `/${getLangFromRoute(route)}/`,
|
||||
});
|
||||
|
||||
@@ -41,7 +42,8 @@ function getRoutes() {
|
||||
});
|
||||
} else {
|
||||
routes.push({
|
||||
path: '/:catchAll(.*)',
|
||||
name: 'NotFound',
|
||||
path: '/:path(.*)+',
|
||||
redirect: () => '/',
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user