index.js
913 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/views/Layout.vue'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
name: 'home',
component: Layout,
children: [
{
path: '',
name: 'myclass',
component: () => import('@/views/MyClass.vue')
},
{
path: 'account',
name: 'account',
component: () => import('@/views/Account.vue')
}
]
},
{
path: '/login',
name: 'login',
component: () => import('@/views/Login.vue')
},
{
path: '/code',
name: 'code',
component: () => import('@/views/Code.vue')
},
{
path: '/detail',
name: 'detail',
component: () => import('@/views/ClassDetail.vue')
}
]
})
export default router