mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
25 lines
396 B
JavaScript
25 lines
396 B
JavaScript
import { demos } from '../../dist/mobile-config';
|
|
|
|
const routes = [];
|
|
const names = Object.keys(demos);
|
|
|
|
Object.keys(demos).forEach((name, index) => {
|
|
if (index === 0) {
|
|
routes.push({
|
|
path: '*',
|
|
redirect: () => `/${names[0]}`
|
|
});
|
|
}
|
|
|
|
routes.push({
|
|
name,
|
|
component: demos[name],
|
|
path: `/${name}`,
|
|
meta: {
|
|
name
|
|
}
|
|
});
|
|
});
|
|
|
|
export default routes;
|