라우터 구조 변경
This commit is contained in:
parent
c77af5ca2a
commit
54729e06c1
@ -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')
|
||||
}
|
||||
]
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="container-xxl flex-grow-1 container-p-y">
|
||||
<div class="row">
|
||||
board
|
||||
board213123
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -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>
|
||||
|
||||
3
src/views/board/TheBoard.vue
Normal file
3
src/views/board/TheBoard.vue
Normal file
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<RouterView />
|
||||
</template>
|
||||
@ -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)),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user