2020-12-25 18:15:04 +08:00
|
|
|
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
|