index.ts 791 B

12345678910111213141516171819202122232425262728293031323334353637
  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: '/sheetshow',
  21. component: () => import('@/views/sheetShow/index.vue'),
  22. name: '表格详情',
  23. },
  24. ];
  25. const router = createRouter({
  26. history: createWebHistory(), //路由模式
  27. routes,
  28. });
  29. router.beforeEach((to,from,next) => {
  30. next();
  31. })
  32. export default router;