import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router' import Layout from '../layout/index.vue' const routes: Array = [ { path: '/', component: Layout, redirect: '/dashboard', children: [ { path: 'dashboard', name: 'Dashboard', component: () => import('../views/dashboard/index.vue'), meta: { title: '工作台' } }, { path: 'personnel', name: 'Personnel', component: () => import('../views/personnel/index.vue'), meta: { title: 'Personnel Evaluation' } }, { path: 'training', name: 'Training', component: () => import('../views/training/index.vue'), meta: { title: 'Training' } }, { path: 'training/detail/:id', name: 'TrainingDetail', component: () => import('../views/training/detail.vue'), meta: { title: 'Course Detail' } }, { path: 'training/study/:courseId/:chapterId', name: 'TrainingStudy', component: () => import('../views/training/study.vue'), meta: { title: 'Chapter Learning' } }, { path: 'data-dashboard', name: 'DataDashboard', component: () => import('../views/data-dashboard/index.vue'), meta: { title: '数据工作台' } } ] } ] const router = createRouter({ history: createWebHistory(), routes }) export default router