Skip to content

Instantly share code, notes, and snippets.

@Kcko
Created May 15, 2024 08:25
Show Gist options
  • Save Kcko/c06c6b36186753f895f3f89e6f5a1af4 to your computer and use it in GitHub Desktop.
Save Kcko/c06c6b36186753f895f3f89e6f5a1af4 to your computer and use it in GitHub Desktop.
<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