index.ts 934 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { createRouter, RouteRecordRaw, createWebHistory } from 'vue-router';
  2. // 扩展路由配置 额外参数
  3. export type AppRouteRecordRaw = RouteRecordRaw & {
  4. hidden?: boolean
  5. }
  6. export const routes: AppRouteRecordRaw[] = [
  7. {
  8. path: '/',
  9. redirect:'/chartshow'
  10. // component: () => import('@/views/home/index.vue'),
  11. // name: '首页',
  12. // hidden: false,
  13. },
  14. {
  15. path: '/chartshow',
  16. component: () => import('@/views/chartShow/index.vue'),
  17. name: '图表详情',
  18. },
  19. {
  20. path: '/chart/preview',
  21. component: () => import('@/views/chartShow/preview.vue'),
  22. name: '图表预览',
  23. },
  24. {
  25. path: '/sheetshow',
  26. component: () => import('@/views/sheetShow/index.vue'),
  27. name: '表格详情',
  28. },
  29. ];
  30. const router = createRouter({
  31. history: createWebHistory(import.meta.env.VITE_APP_BASE_URL),
  32. routes,
  33. });
  34. router.beforeEach((to,from,next) => {
  35. next();
  36. })
  37. export default router;