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

@@ -29,25 +29,25 @@ function getRoutes() {
if (langs.length) {
routes.push({
path: '*',
redirect: route => `/${getLangFromRoute(route)}/`
redirect: route => `/${getLangFromRoute(route)}/`,
});
langs.forEach(lang => {
routes.push({
path: `/${lang}`,
component: DemoHome,
meta: { lang }
meta: { lang },
});
});
} else {
routes.push({
path: '*',
redirect: () => '/'
redirect: () => '/',
});
routes.push({
path: '/',
component: DemoHome
component: DemoHome,
});
}
@@ -62,8 +62,8 @@ function getRoutes() {
component: demos[name],
meta: {
name,
lang
}
lang,
},
});
});
} else {
@@ -72,8 +72,8 @@ function getRoutes() {
path: `/${component}`,
component: demos[name],
meta: {
name
}
name,
},
});
}
});
@@ -86,7 +86,7 @@ Vue.use(VueRouter);
export const router = new VueRouter({
mode: 'hash',
routes: getRoutes(),
scrollBehavior: (to, from, savedPosition) => savedPosition || { x: 0, y: 0 }
scrollBehavior: (to, from, savedPosition) => savedPosition || { x: 0, y: 0 },
});
router.afterEach(() => {