0 votes
in VueJS by

What is the structure of async component factory?

1 Answer

0 votes
by

Async component factory is useful to resolve the component asynchronously. The async component factory can return an object of the below format.

const AsyncComponent = () => ({

  // The component to load (should be a Promise)

  component: import('./MyComponent.vue'),

  // A component to use while the async component is loading

  loading: LoadingComponent,

  // A component to use if the load fails

  error: ErrorComponent,

  // Delay before showing the loading component. Default: 200ms.

  delay: 200,

  // The error component will be displayed if a timeout is

  // provided and exceeded. Default: Infinity.

  timeout: 3000

})

Related questions

0 votes
asked Jan 9, 2020 in VueJS by GeorgeBell
0 votes
asked Sep 15, 2023 in VueJS by JackTerrance
...