PixelAI-admin/vue-admin-wonderful-next/src/router/index.ts

40 lines
902 B
TypeScript
Raw Normal View History

import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router"
const staticRoutes: Array<RouteRecordRaw> = [
{
path: '/',
name: 'home',
component: () => import('/@/views/layout/index.vue'),
redirect: '/home',
meta: {
title: '首页'
},
children: [{
path: '/home',
name: 'home',
component: () => import('/@/views/home/index.vue'),
meta: {
title: '首页'
}
}]
},
{
path: '/login',
name: 'login',
component: () => import('/@/views/login/index.vue'),
meta: {
title: '登陆'
}
},
{
path: '/:pathMatch(.*)',
redirect: '/'
}
]
const router = createRouter({
history: createWebHashHistory(),
routes: staticRoutes
})
export default router