mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
29 lines
435 B
JavaScript
29 lines
435 B
JavaScript
import decamelize from 'decamelize';
|
|
import { documents } from 'desktop-entry';
|
|
|
|
const routes = [];
|
|
const names = Object.keys(documents);
|
|
|
|
routes.push({
|
|
path: '/home',
|
|
component: documents.Home
|
|
});
|
|
|
|
routes.push({
|
|
path: '*',
|
|
redirect: '/home'
|
|
});
|
|
|
|
names.forEach(name => {
|
|
routes.push({
|
|
name,
|
|
component: documents[name],
|
|
path: `/${decamelize(name, '-')}`,
|
|
meta: {
|
|
name
|
|
}
|
|
});
|
|
});
|
|
|
|
export { routes };
|