import { createRouter, createWebHistory } from 'vue-router' const routes: Array = [ { path: '/', name: '首页', title: '首页', component: () => import('@/layout/layout.vue'), children: [ { path: '/dashboard', name: '仪表盘', component: () => import('@/pages/Dashboard/index.vue'), children: [ { path: '/dashboard-item', name: '仪表盘item', component: () => import('@/pages/Dashboard/index.vue') } ] } ] }, { path: '/visual', name: '视觉平台', title: '视觉平台', component: () => import('@/layout/layout.vue'), children: [ { path: '/visual-dashboard', name: '仪表盘', component: () => import('@/pages/Dashboard/index.vue'), children: [ { path: '/visual-dashboard-item', name: '仪表盘item', component: () => import('@/pages/Dashboard/index.vue') } ] } ] }, { path: '/iot', name: '物联网', component: () => import('@/layout/layout.vue'), redirect: '/iot/dashboard', children: [ { path: '/iot/dashboard', name: '物联网', redirect: '/iot/dashboard-item', children: [ { path: '/iot/dashboard-item', name: '物联网', component: () => import('@/pages/Iot/index.vue') } ] }, { path: '/net/dashboard', name: '互联网', component: () => import('@/pages/Iot/net.vue') } ] } ] const router = createRouter({ history: createWebHistory(process.env.BASE_URL), routes }) export default router