localhost-front/src/router/index.js
2025-01-17 12:52:30 +09:00

65 lines
1.7 KiB
JavaScript

import { createRouter, createWebHistory } from 'vue-router'
// 초기 렌더링 속도를 위해 지연 로딩 사용
const routes = [
{
path: '/',
component: () => import('@v/MainView.vue'),
// meta: { requiresAuth: true }
},
{
path: '/board',
component: () => import('@v/board/TheBoard.vue'),
children: [
{
path: '',
name: 'BoardList',
component: () => import('@v/board/BoardList.vue')
},
{
path: 'write',
component: () => import('@v/board/BoardWrite.vue')
},
{
path: ':id',
name: 'BoardDetail',
component: () => import('@v/board/BoardView.vue')
},
{
path: 'edit/:id',
name: 'BoardEdit',
component: () => import('@v/board/BoardEdit.vue')
}
]
},
{
path: '/wordDict',
component: () => import('@v/wordDict/wordDict.vue'),
},
// 레이아웃 필요없을 때 예시
// {
// path: '/login',
// component: () => import('@v/user/TheLogin.vue'),
// meta: { layout: 'NoLayout' },
// },
{
path: '/vacation',
component: () => import('@v/vacation/VacationManagement.vue'),
},
{
path: '/sample',
component: () => import('@c/calendar/SampleCalendar.vue'),
},
{
path: "/:anything(.*)",
component: () => import('@v/ErrorPage.vue'),
}
];
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: routes,
})
export default router