Vue · Middle · Question 31 of 75
How do you lazy-load a route component?
- ✓Correct answer:
{ path: '/admin', component: () => import('./views/Admin.vue') } - 2
{ path: '/admin', component: lazy(Admin) } - 3Add
lazy: trueto the route
Explanation
The bundler creates a separate chunk that is downloaded on first navigation. Don't use defineAsyncComponent for route components - the router handles it.