router.ts 731 B

1234567891011121314151617181920212223242526272829
  1. import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
  2. const routes: Array<RouteRecordRaw> = [];
  3. // import { nav } from '@/config';
  4. // nav.forEach(item => {
  5. // item.packages.forEach(_item => {
  6. // if (_item.show) {
  7. // routes.push({
  8. // path: `/${_item.name}`,
  9. // name: _item.name,
  10. // components: {
  11. // main: () => import(`@/packages/${_item.name.toLocaleLowerCase()}/demo.vue`),
  12. // }
  13. // })
  14. // }
  15. // })
  16. // })
  17. const files = require.context("@/packages", true, /doc\.md$/);
  18. files.keys().forEach(component => {
  19. // console.log(component)
  20. });
  21. const router = createRouter({
  22. history: createWebHashHistory(),
  23. routes
  24. });
  25. export default router;