localhost-front/src/router/index.js

50 lines
1.2 KiB
JavaScript

import { createRouter, createWebHistory } from 'vue-router'
import BoardWrite from '@v/board/BoardWrite.vue';
// 초기 렌더링 속도를 위해 지연 로딩 사용
const routes = [
{
path: '/',
component: () => import('@v/MainView.vue'),
// meta: { requiresAuth: true }
},
{
path: '/board',
component: () => import('@v/board/TheBoard.vue'),
children : [
{
path : '',
component : () => import('@v/board/BoardList.vue')
},
{
path : 'write',
component : () => import('@v/board/BoardWrite.vue')
},
{
path : 'get/:id',
component : () => import('@v/board/BoardView.vue')
}
]
},
// {
// path: "/login",
// component: () => import('@v/Login.vue'),
// // meta: { requiresAuth: false }
// },
// {
// path : "/error/:code",
// component: () => import('@v/ErrorPage.vue'),
// },
{
// path: '/:anything(.*)',
// component: () => import('@v/MainView.vue'),
},
]
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: routes,
})
export default router