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
| import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
| import type {RouteRecordRaw} from "vue-router"
| const routes: Array<RouteRecordRaw> = [
| {
| path: '/',
| redirect: '/index',
| },
| {
| path: '/home',
| name: 'home',
| component: () => import('@/views/HomeView.vue'),
| children:[
| {
| path: '/index',
| name: 'index',
| component: () => import('@/views/index/index.vue'),
| }
| ]
| },
| ]
| const router = createRouter({
| history: createWebHashHistory(import.meta.env.BASE_URL),
| routes,
| })
|
| router.beforeEach((to, from, next) => {
| next();
| })
|
| export default router
|
|