mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
chore(cli): fix missing route name
This commit is contained in:
parent
1aee7f5e66
commit
265ca82686
@ -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 },
|
||||||
|
@ -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: {
|
||||||
|
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user