ZhangXianQiang
2024-06-05 27f869c1e6c0c79f763a34bfffc09a55c1841cc1
src/router/index.js
@@ -1,13 +1,45 @@
import { createMemoryHistory, createRouter } from 'vue-router'
import { createMemoryHistory, createRouter } from 'vue-router';
import Layout from '@/layout/index.vue';
const routes = [
  { path: '/', component: () => import('@/views/home/index.vue') },
]
  {
    path: '/',
    redirect: '/exam'
  },
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: 'index',
        name: 'index',
        component: () => import('@/views/home/index.vue'),
      },
      {
        path: 'menu',
        name: 'menu',
        component: () => import('@/views/menu/index.vue')
      },
    ]
  },
  // 考试列表
  {
    path: '/exam-list',
    component: () => import('@/views/exam-list/index.vue'),
  },
  // 考试页面
  {
    path: '/exam',
    component: () => import('@/views/exam/index.vue'),
  },
];
const router = createRouter({
  history: createMemoryHistory(),
  routes,
})
});
export default router;