Created
January 30, 2021 13:11
-
-
Save fadamakis/8307754a64d5df29c40ea3c4c85bb7e3 to your computer and use it in GitHub Desktop.
Handling Loading State - Long format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
}) |
currently the
component
property updated asloader
Thanks @rizkhal That's one of the changes in Vue 3 that also uses defineAsyncComponent helper. But this is based on Vue 2 docs.
Thanks @fadamakis, this is my fault for skipping a few lines in your article
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
currently the
component
property updated asloader