|
1 | 1 | import { createRouter, createWebHistory } from 'vue-router' |
2 | 2 | import { getActivePinia } from 'pinia' |
3 | 3 | import { useAuthStore } from '@/stores/useAuthStore' |
4 | | -import HomePage from '@/pages/HomePage.vue' |
5 | | -import CompanionBoard from '@/pages/CompanionBoard.vue' |
6 | | -import CommunityHome from '@/pages/CommunityHome.vue' |
7 | | -import LoginPage from '@/pages/LoginPage.vue' |
8 | | -import SignUpPage from '@/pages/SignUpPage.vue' |
9 | | -import CommunityBoard from '@/pages/CommunityBoard.vue' |
10 | | -import CallbacKkakao from '@/components/Auth/CallbacKkakao.vue' |
11 | | -import CallbacNaver from '@/components/Auth/CallbacNaver.vue' |
12 | | -import CommunityDetail from '@/pages/CommunityDetail.vue' |
13 | | -import CompanionWrite from '@/pages/CompanionWrite.vue' |
14 | | -import CommunityWrite from '@/pages/CommunityWrite.vue' |
15 | | -import CompanionDetail from '@/pages/CompanionDetail.vue' |
16 | | -import NotFound from '@/pages/NotFound.vue' |
17 | | -import HotelReservation from '@/pages/HotelReservation.vue' |
18 | | -import ProfilePage from '@/pages/ProfilePage.vue' |
19 | | -import MyProfile from '@/pages/MyProfile.vue' |
20 | | -import FollowPage from '@/pages/FollowPage.vue' |
21 | | -import SettingPage from '@/pages/SettingPage.vue' |
22 | | -import StoryPage from '@/pages/StoryPage.vue' |
23 | | -import MyTripsPage from '@/pages/MyTripsPage.vue' |
24 | 4 |
|
25 | 5 | const router = createRouter({ |
26 | 6 | history: createWebHistory(import.meta.env.BASE_URL), |
27 | 7 | routes: [ |
28 | 8 | { |
29 | 9 | path: '/', |
30 | 10 | name: 'home', |
31 | | - component: HomePage, |
| 11 | + component: () => import('@/pages/HomePage.vue'), |
32 | 12 | }, |
33 | 13 | { |
34 | 14 | path: '/companion-board/:country', |
35 | 15 | name: 'CompanionBoard', |
36 | | - component: CompanionBoard, |
37 | | - // props: true, |
| 16 | + component: () => import('@/pages/CompanionBoard.vue'), |
38 | 17 | }, |
39 | 18 | { |
40 | 19 | path: '/community-board/:country', |
41 | 20 | name: 'CommmunityBoardPage', |
42 | | - component: CommunityBoard, |
| 21 | + component: () => import('@/pages/CommunityBoard.vue'), |
43 | 22 | }, |
44 | 23 | { |
45 | 24 | path: '/community', |
46 | 25 | name: 'Community', |
47 | | - component: CommunityHome, |
| 26 | + component: () => import('@/pages/CommunityHome.vue'), |
48 | 27 | }, |
49 | 28 | { |
50 | 29 | path: '/login', |
51 | 30 | name: 'login', |
52 | | - component: LoginPage, |
| 31 | + component: () => import('@/pages/LoginPage.vue'), |
53 | 32 | meta: { hideLayout: true }, |
54 | 33 | }, |
55 | 34 | { |
56 | 35 | path: '/signup', |
57 | 36 | name: 'signup', |
58 | | - component: SignUpPage, |
| 37 | + component: () => import('@/pages/SignUpPage.vue'), |
59 | 38 | meta: { hideLayout: true }, |
60 | 39 | }, |
61 | 40 | { |
62 | 41 | path: '/login/callback/kakao', |
63 | 42 | name: 'callbackkakao', |
64 | | - component: CallbacKkakao, |
| 43 | + component: () => import('@/components/Auth/CallbacKkakao.vue'), |
65 | 44 | }, |
66 | 45 | { |
67 | 46 | path: '/login/callback/naver', |
68 | 47 | name: 'callbacnaver', |
69 | | - component: CallbacNaver, |
| 48 | + component: () => import('@/components/Auth/CallbacNaver.vue'), |
70 | 49 | }, |
71 | 50 | { |
72 | | - path: '/community/write', // 새 글 작성 |
| 51 | + path: '/community/write', |
73 | 52 | name: 'CommunityCreate', |
74 | | - component: CommunityWrite, |
| 53 | + component: () => import('@/pages/CommunityWrite.vue'), |
75 | 54 | }, |
76 | | - { |
| 55 | + { |
77 | 56 | path: '/community/write/:country/edit/:id', |
78 | 57 | name: 'CommunityEdit', |
79 | | - component: CommunityWrite, |
| 58 | + component: () => import('@/pages/CommunityWrite.vue'), |
80 | 59 | props: true, |
81 | 60 | }, |
82 | 61 | { |
83 | 62 | path: '/community/:id', |
84 | 63 | name: 'CommunityDetail', |
85 | | - component: CommunityDetail, |
| 64 | + component: () => import('@/pages/CommunityDetail.vue'), |
86 | 65 | props: true, |
87 | 66 | }, |
88 | 67 | { |
89 | 68 | path: '/companion/write', |
90 | 69 | name: 'CompanionCreate', |
91 | | - component: CompanionWrite, |
| 70 | + component: () => import('@/pages/CompanionWrite.vue'), |
92 | 71 | }, |
93 | 72 | { |
94 | 73 | path: '/companion-board/:country/detail/:id', |
95 | 74 | name: 'CompanionDetail', |
96 | | - component: CompanionDetail, |
| 75 | + component: () => import('@/pages/CompanionDetail.vue'), |
97 | 76 | props: true, |
98 | 77 | }, |
99 | 78 | { |
100 | 79 | path: '/companion/write/:country/edit/:id', |
101 | | - component: CompanionWrite, |
| 80 | + component: () => import('@/pages/CompanionWrite.vue'), |
102 | 81 | }, |
103 | 82 | { |
104 | 83 | path: '/hotelreservation', |
105 | 84 | name: 'HotelReservation', |
106 | | - component: HotelReservation, |
| 85 | + component: () => import('@/pages/HotelReservation.vue'), |
107 | 86 | }, |
108 | 87 | { |
109 | 88 | path: '/:pathMatch(.*)*', |
110 | 89 | name: 'NotFound', |
111 | | - component: NotFound, |
| 90 | + component: () => import('@/pages/NotFound.vue'), |
112 | 91 | meta: { hideLayout: true }, |
113 | 92 | }, |
114 | 93 | { |
115 | 94 | path: '/mytripspage', |
116 | 95 | name: 'MyTripsPage', |
117 | | - component: MyTripsPage, |
| 96 | + component: () => import('@/pages/MyTripsPage.vue'), |
118 | 97 | }, |
119 | 98 | { |
120 | 99 | path: '/profile', |
121 | 100 | name: 'ProfilePage', |
122 | | - component: ProfilePage, |
| 101 | + component: () => import('@/pages/ProfilePage.vue'), |
123 | 102 | children: [ |
124 | 103 | { |
125 | 104 | path: '', |
126 | 105 | name: 'MyProfile', |
127 | | - component: MyProfile, |
| 106 | + component: () => import('@/pages/MyProfile.vue'), |
128 | 107 | }, |
129 | 108 | { |
130 | 109 | path: 'follow', |
131 | 110 | name: 'FollowPage', |
132 | | - component: FollowPage, |
| 111 | + component: () => import('@/pages/FollowPage.vue'), |
133 | 112 | }, |
134 | 113 | { |
135 | 114 | path: 'story', |
136 | 115 | name: 'StoryPage', |
137 | | - component: StoryPage, |
| 116 | + component: () => import('@/pages/StoryPage.vue'), |
138 | 117 | }, |
139 | 118 | { |
140 | 119 | path: 'setting', |
141 | 120 | name: 'SettingPage', |
142 | | - component: SettingPage, |
| 121 | + component: () => import('@/pages/SettingPage.vue'), |
143 | 122 | }, |
144 | 123 | ], |
145 | 124 | }, |
|
0 commit comments