fix(cli): nav route matching

This commit is contained in:
陈嘉涵
2019-12-13 11:23:14 +08:00
parent 63963534d0
commit 9977056d50
4 changed files with 23 additions and 13 deletions

View File

@@ -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;