mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 19:24:16 +00:00
build: add files of vant-cli 2
This commit is contained in:
24
packages/vant-cli/site/mobile/router.js
Normal file
24
packages/vant-cli/site/mobile/router.js
Normal file
@@ -0,0 +1,24 @@
|
||||
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;
|
Reference in New Issue
Block a user