Vue · Middle · Question 16 of 75
What does defineAsyncComponent do?
const Chart = defineAsyncComponent(() => import("./Chart.vue"));- ✓Correct answer: Loads the component's code on demand, in a separate chunk, the first time it renders
- 2Runs the component in a Web Worker
- 3Makes all props asynchronous
Explanation
The options form adds loadingComponent, errorComponent, delay and timeout. Combine with v-if so heavy widgets download only when needed.