라우터 구조 변경

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

View File

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

View File

@ -1,9 +1,5 @@
<template> <template>
<div class="container-xxl flex-grow-1 container-p-y"> dasdasdas
<div class="row">
board
</div>
</div>
</template> </template>
<script setup> <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/ // https://vite.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [ plugins: [
vue(), vue(),
vueDevTools(), vueDevTools(),
], ],
resolve: { resolve: {
alias: { alias: {
'@' : fileURLToPath(new URL('./src' , import.meta.url)), '@': fileURLToPath(new URL('./src', import.meta.url)),
'@a': fileURLToPath(new URL('./src/assets/' , import.meta.url)), '@a': fileURLToPath(new URL('./src/assets/', import.meta.url)),
'@c': fileURLToPath(new URL('./src/components/' , import.meta.url)), '@c': fileURLToPath(new URL('./src/components/', import.meta.url)),
'@v': fileURLToPath(new URL('./src/views/' , import.meta.url)), '@v': fileURLToPath(new URL('./src/views/', import.meta.url)),
'@l': fileURLToPath(new URL('./src/layout/' , import.meta.url)), '@l': fileURLToPath(new URL('./src/layout/', import.meta.url)),
'@s': fileURLToPath(new URL('./src/stores/' , import.meta.url)), '@s': fileURLToPath(new URL('./src/stores/', import.meta.url)),
'@p': fileURLToPath(new URL('./src/common/plugin/' , import.meta.url)), '@p': fileURLToPath(new URL('./src/common/plugin/', import.meta.url)),
},
}, },
},
}) })