初始化
This commit is contained in:
50
src/router/index.js
Normal file
50
src/router/index.js
Normal file
@@ -0,0 +1,50 @@
|
||||
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'),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes,
|
||||
});
|
||||
|
||||
export default router;
|
||||
|
||||
Reference in New Issue
Block a user