mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(cli): nav route matching
This commit is contained in:
parent
63963534d0
commit
9977056d50
@ -52,7 +52,7 @@ export default {
|
||||
},
|
||||
|
||||
base() {
|
||||
return this.lang ? `/${this.lang}` : '';
|
||||
return this.lang ? `/${this.lang}/` : '/';
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -20,8 +20,7 @@ export default {
|
||||
},
|
||||
|
||||
path() {
|
||||
const { path } = this.item;
|
||||
return this.base ? `${this.base}/${path}` : path;
|
||||
return `${this.base}${this.item.path}`;
|
||||
},
|
||||
|
||||
active() {
|
||||
|
@ -74,15 +74,26 @@ function getRoutes() {
|
||||
addHomeRoute(documents[name], lang);
|
||||
}
|
||||
|
||||
routes.push({
|
||||
name: `${lang}/${component}`,
|
||||
path: `/${lang}/${component}`,
|
||||
component: documents[name],
|
||||
meta: {
|
||||
lang,
|
||||
name: component
|
||||
}
|
||||
});
|
||||
if (lang) {
|
||||
routes.push({
|
||||
name: `${lang}/${component}`,
|
||||
path: `/${lang}/${component}`,
|
||||
component: documents[name],
|
||||
meta: {
|
||||
lang,
|
||||
name: component
|
||||
}
|
||||
});
|
||||
} else {
|
||||
routes.push({
|
||||
name: `${component}`,
|
||||
path: `/${component}`,
|
||||
component: documents[name],
|
||||
meta: {
|
||||
name: component
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return routes;
|
||||
|
@ -46,7 +46,7 @@ function getRoutes() {
|
||||
});
|
||||
|
||||
routes.push({
|
||||
path: '',
|
||||
path: '/',
|
||||
component: DemoHome
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user