import { createRouter, createWebHistory } from 'vue-router'; import Layout from '../layout/Layout.vue'; const routes = [ { path: '/', component: Layout, children: [ { path: '', name: 'Dashboard', component: () => import('../views/Dashboard.vue'), }, { path: 'interview', name: 'Interview', component: () => import('../views/InterviewView.vue'), }, { path: 'question-bank', name: 'QuestionBank', component: () => import('../views/QuestionBank.vue'), }, { path: 'history', name: 'InterviewHistory', component: () => import('../views/InterviewHistory.vue'), }, { path: 'report/:sessionId', name: 'InterviewReport', component: () => import('../views/InterviewReport.vue'), props: true, // 将路由参数作为props传递给组件 }, { path: 'answer-record', name: 'AnswerRecord', component: () => import('../views/AnswerRecord.vue'), }, { path: 'question-category', name: 'QuestionCategory', component: () => import('@/views/question-category/index.vue'), }, ], }, ]; const router = createRouter({ history: createWebHistory(), routes, }); export default router;