mallBackend/src/router/index.ts

46 lines
1.1 KiB
TypeScript
Raw Normal View History

2023-12-02 11:33:44 +08:00
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import test from './module/test'
import myInfo from './module/myInfo'
const routes: Array<RouteRecordRaw> = [
{
path: '/index',
name: 'index',
component: () => import('views/Index.vue'),
meta: {
title: '目录页',
keepAlive: true,
AuthFlag: false
}
},
{
path: '/test', // 主路由地址
name: 'testIndex',
component: () => import('views/test/Index.vue'), // 组件加载
meta: {
title: '测试',
keepAlive: true,
AuthFlag: false
},
children: [...test]
},
{
path: '/myInfo', // 主路由地址
name: 'myInfo',
component: () => import('views/myInfo/Index.vue'), // 组件加载
meta: {
title: '我的',
keepAlive: true,
AuthFlag: false
},
children: [...myInfo]
}
]
const router = createRouter({
// 路由模式
history: createWebHashHistory(),
routes
})
export default router