import { createRouter, createWebHashHistory } from 'vue-router' import Home from '@/views/Home.vue' import Layout from '@/layout/Index.vue' import NotFound from '@/views/error/404.vue' const constantRoutes = [ { path: '/layout', component: Layout, redirect: to => { return '/' }, children: [ { path: '/', component: Home }, { path: '/mailbox', component: () => import('@/components/ManageMail.vue'), }, { path: '/mailbox/detail/:id', component: () => import('@/components/MailDetail.vue') }, { path: '/holiday', component: () => import('@/components/HolidayList.vue') } ] }, { path: '/:catchAll(.*)', component: NotFound, meta: { title: '404' } } ]; const router = createRouter({ history: createWebHashHistory(), routes: constantRoutes }); export default router;