Skip to content

Commit 79a1e60

Browse files
Kiansaposva
andauthored
docs: lazy loading example (vuejs#1995)
Co-authored-by: Eduardo San Martin Morote <[email protected]>
1 parent 5c75d3a commit 79a1e60

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/docs/guide/advanced/lazy-loading.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ const UserDetails = () => import('./views/UserDetails.vue')
1717

1818
const router = createRouter({
1919
// ...
20-
routes: [{ path: '/users/:id', component: UserDetails }],
20+
routes: [
21+
{ path: '/users/:id', component: UserDetails }
22+
// or use it directly in the route definition
23+
{ path: '/users/:id', component: () => import('./views/UserDetails.vue') },
24+
],
2125
})
2226
```
2327

0 commit comments

Comments
 (0)