Created
May 15, 2024 08:25
-
-
Save Kcko/c06c6b36186753f895f3f89e6f5a1af4 to your computer and use it in GitHub Desktop.
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
<template> | |
<div> | |
<h1>Async Component Example</h1> | |
<suspense> | |
<template #default> | |
<AsyncComponent /> | |
</template> | |
<template #fallback> | |
<LoadingSpinner /> | |
</template> | |
</suspense> | |
</div> | |
</template> | |
<script setup> | |
import { defineAsyncComponent } from 'vue'; | |
const AsyncComponent = defineAsyncComponent(() => | |
import('./AsyncComponent.vue') | |
); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment