chore(cli): update eslint config and prettier codes

This commit is contained in:
陈嘉涵
2020-01-19 11:42:22 +08:00
parent 633e9cf59d
commit 1691451813
52 changed files with 383 additions and 363 deletions

View File

@@ -20,13 +20,13 @@ function parseName(name) {
return {
component: `${decamelize(component)}`,
lang: pairs.join('-')
lang: pairs.join('-'),
};
}
return {
component: `${decamelize(name)}`,
lang: ''
lang: '',
};
}
@@ -48,12 +48,12 @@ function getRoutes() {
if (locales) {
routes.push({
path: '*',
redirect: route => `/${getLangFromRoute(route)}/`
redirect: route => `/${getLangFromRoute(route)}/`,
});
} else {
routes.push({
path: '*',
redirect: '/'
redirect: '/',
});
}
@@ -62,7 +62,7 @@ function getRoutes() {
name: lang,
path: `/${lang || ''}`,
component: Home,
meta: { lang }
meta: { lang },
});
}
@@ -80,8 +80,8 @@ function getRoutes() {
component: documents[name],
meta: {
lang,
name: component
}
name: component,
},
});
} else {
routes.push({
@@ -89,8 +89,8 @@ function getRoutes() {
path: `/${component}`,
component: documents[name],
meta: {
name: component
}
name: component,
},
});
}
});
@@ -109,7 +109,7 @@ export const router = new VueRouter({
}
return { x: 0, y: 0 };
}
},
});
router.afterEach(() => {