Files
simple-element-plus-template/src/route/routes.js
2023-12-29 17:22:14 +08:00

42 lines
1.0 KiB
JavaScript

import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '@/views/HomeView.vue'
import AdminRoutes from '@/route/AdminRoutes'
import ToolsRoutes from '@/route/ToolsRoutes'
const router = createRouter({
history: createWebHashHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
name: 'home',
component: HomeView,
children: [{
path: '',
name: 'index',
component: () => import('@/views/Index.vue'),
meta: {
labelKey: 'common.label.index'
}
}, {
path: 'about',
name: 'about',
component: () => import('@/views/account/AboutView.vue')
}, {
path: 'personal',
name: 'personal',
component: () => import('@/views/account/PersonalInfo.vue')
},
{
path: '/:pathMatch(.*)*',
name: 'notFound',
component: () => import('@/views/404.vue')
},
...AdminRoutes,
...ToolsRoutes
]
}
]
})
export default router