index.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import { createRouter, createWebHistory } from 'vue-router'
  2. const routes: Array<ROUTER.RoutesProps> = [
  3. {
  4. path: '/',
  5. name: '首页',
  6. title: '首页',
  7. component: () => import('@/layout/layout.vue'),
  8. children: [
  9. {
  10. path: '/dashboard',
  11. name: '仪表盘',
  12. component: () => import('@/pages/Dashboard/index.vue'),
  13. children: [
  14. {
  15. path: '/dashboard-item',
  16. name: '仪表盘item',
  17. component: () => import('@/pages/Dashboard/index.vue')
  18. }
  19. ]
  20. }
  21. ]
  22. },
  23. {
  24. path: '/visual',
  25. name: '视觉平台',
  26. title: '视觉平台',
  27. component: () => import('@/layout/layout.vue'),
  28. children: [
  29. {
  30. path: '/visual-dashboard',
  31. name: '仪表盘',
  32. component: () => import('@/pages/Dashboard/index.vue'),
  33. children: [
  34. {
  35. path: '/visual-dashboard-item',
  36. name: '仪表盘item',
  37. component: () => import('@/pages/Dashboard/index.vue')
  38. }
  39. ]
  40. }
  41. ]
  42. },
  43. {
  44. path: '/iot',
  45. name: '物联网',
  46. component: () => import('@/layout/layout.vue'),
  47. redirect: '/iot/dashboard',
  48. children: [
  49. {
  50. path: '/iot/dashboard',
  51. name: '物联网',
  52. redirect: '/iot/dashboard-item',
  53. children: [
  54. {
  55. path: '/iot/dashboard-item',
  56. name: '物联网',
  57. component: () => import('@/pages/Iot/index.vue')
  58. }
  59. ]
  60. },
  61. {
  62. path: '/net/dashboard',
  63. name: '互联网',
  64. component: () => import('@/pages/Iot/net.vue')
  65. }
  66. ]
  67. }
  68. ]
  69. const router = createRouter({
  70. history: createWebHistory(process.env.BASE_URL),
  71. routes
  72. })
  73. export default router