mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 10:07:07 +00:00
build: add files of vant-cli 2
This commit is contained in:
24
packages/vant-cli/site/desktop/router.js
Normal file
24
packages/vant-cli/site/desktop/router.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { documents } from '../../dist/desktop-config';
|
||||
|
||||
const routes = [];
|
||||
const names = Object.keys(documents);
|
||||
|
||||
Object.keys(documents).forEach((name, index) => {
|
||||
if (index === 0) {
|
||||
routes.push({
|
||||
path: '*',
|
||||
redirect: () => `/${names[0]}`
|
||||
});
|
||||
}
|
||||
|
||||
routes.push({
|
||||
name,
|
||||
component: documents[name],
|
||||
path: `/${name}`,
|
||||
meta: {
|
||||
name
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
export default routes;
|
Reference in New Issue
Block a user