Skip to content

Commit 5270481

Browse files
committed
refactor: switch Home component to lazy loading in router configuration
1 parent d5b6c67 commit 5270481

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/router.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { RouteParams, RouteRecordRaw } from 'vue-router'
22
import { createRouter, createWebHashHistory } from 'vue-router'
3-
import Home from './pages/Home.vue'
43
import { isAuthorized } from './store/user'
54

65
export type AppRouteNames =
@@ -20,17 +19,17 @@ export const routes: RouteRecordRaw[] = [
2019
{
2120
name: 'global-feed',
2221
path: '/',
23-
component: Home,
22+
component: () => import('./pages/Home.vue'),
2423
},
2524
{
2625
name: 'my-feed',
2726
path: '/my-feeds',
28-
component: Home,
27+
component: () => import('./pages/Home.vue'),
2928
},
3029
{
3130
name: 'tag',
3231
path: '/tag/:tag',
33-
component: Home,
32+
component: () => import('./pages/Home.vue'),
3433
},
3534
{
3635
name: 'article',

0 commit comments

Comments
 (0)