chore(cli): fix missing route name

This commit is contained in:
chenjiahan 2020-11-21 21:08:41 +08:00
parent 1aee7f5e66
commit 265ca82686
3 changed files with 5 additions and 3 deletions

View File

@ -61,7 +61,7 @@ function getRoutes() {
function addHomeRoute(Home, lang) { function addHomeRoute(Home, lang) {
routes.push({ routes.push({
name: lang, name: lang || 'home',
path: `/${lang || ''}`, path: `/${lang || ''}`,
component: Home, component: Home,
meta: { lang }, meta: { lang },

View File

@ -35,6 +35,7 @@ function getRoutes() {
langs.forEach((lang) => { langs.forEach((lang) => {
routes.push({ routes.push({
name: lang,
path: `/${lang}`, path: `/${lang}`,
component: DemoHome, component: DemoHome,
meta: { lang }, meta: { lang },
@ -48,6 +49,7 @@ function getRoutes() {
}); });
routes.push({ routes.push({
name: 'home',
path: '/', path: '/',
component: DemoHome, component: DemoHome,
}); });
@ -70,7 +72,7 @@ function getRoutes() {
}); });
} else { } else {
routes.push({ routes.push({
name, name: component,
path: `/${component}`, path: `/${component}`,
component: demos[name], component: demos[name],
meta: { meta: {

View File

@ -9,7 +9,7 @@ export function toArray<T>(item: T | T[]): T[] {
} }
export function readFileContent(file: File, resultType: ResultType) { export function readFileContent(file: File, resultType: ResultType) {
return new Promise<string | ArrayBuffer | null | undefined>((resolve) => { return new Promise<string | ArrayBuffer | null | void>((resolve) => {
if (resultType === 'file') { if (resultType === 'file') {
resolve(); resolve();
return; return;