라우터 구조 변경

This commit is contained in:
ckx6954 2024-12-16 14:11:49 +09:00
parent c77af5ca2a
commit 54729e06c1
5 changed files with 30 additions and 25 deletions

View File

@ -1,4 +1,5 @@
import { createRouter, createWebHistory } from 'vue-router'
import BoardWrite from '@v/board/BoardWrite.vue';
// 초기 렌더링 속도를 위해 지연 로딩 사용
const routes = [
@ -11,16 +12,21 @@ const routes = [
{
path: '/board',
name : 'board',
component: () => import('@v/board/BoardList.vue'),
component: () => import('@v/board/TheBoard.vue'),
children : [
{
path : "write",
name : 'write',
path : '',
name : 'boardList',
component : () => import('@v/board/BoardList.vue')
},
{
path : 'write',
name : 'boardWrite',
component : () => import('@v/board/BoardWrite.vue')
},
{
path : "get/:id",
name : 'create',
path : 'get/:id',
name : 'boardView',
component : () => import('@v/board/BoardView.vue')
}
]

View File

@ -1,7 +1,7 @@
<template>
<div class="container-xxl flex-grow-1 container-p-y">
<div class="row">
board
board213123
</div>
</div>
</template>

View File

@ -1,9 +1,5 @@
<template>
<div class="container-xxl flex-grow-1 container-p-y">
<div class="row">
board
</div>
</div>
dasdasdas
</template>
<script setup>

View File

@ -0,0 +1,3 @@
<template>
<RouterView />
</template>

View File

@ -5,19 +5,19 @@ import vueDevTools from 'vite-plugin-vue-devtools'
// https://vite.dev/config/
export default defineConfig({
plugins: [
vue(),
vueDevTools(),
],
resolve: {
alias: {
'@' : fileURLToPath(new URL('./src' , import.meta.url)),
'@a': fileURLToPath(new URL('./src/assets/' , import.meta.url)),
'@c': fileURLToPath(new URL('./src/components/' , import.meta.url)),
'@v': fileURLToPath(new URL('./src/views/' , import.meta.url)),
'@l': fileURLToPath(new URL('./src/layout/' , import.meta.url)),
'@s': fileURLToPath(new URL('./src/stores/' , import.meta.url)),
'@p': fileURLToPath(new URL('./src/common/plugin/' , import.meta.url)),
plugins: [
vue(),
vueDevTools(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'@a': fileURLToPath(new URL('./src/assets/', import.meta.url)),
'@c': fileURLToPath(new URL('./src/components/', import.meta.url)),
'@v': fileURLToPath(new URL('./src/views/', import.meta.url)),
'@l': fileURLToPath(new URL('./src/layout/', import.meta.url)),
'@s': fileURLToPath(new URL('./src/stores/', import.meta.url)),
'@p': fileURLToPath(new URL('./src/common/plugin/', import.meta.url)),
},
},
},
})