Jul 14, 2024
useFetch
and useAsyncData
useFetch
: straightforward method for data fetching.useAsyncData
: wraps asynchronous logic for complex calls (e.g., third-party libraries like Supabase).useFetch
= useAsyncData
in most cases.Vue Suspense
to prevent navigation until all async functions are resolved.products.vue
uses useFetch
to fetch and display products.nuxt-loading-indicator
: built-in component to show progress bar during navigation.lazy
property set to true
.pending
variable to show loading state.products.vue
to use lazy
option.Nuxt UI Library
for better UI: install using command.NuSkeleton
component to create a skeleton for the layout.useLazyFetch
and useLazyAsyncData
: equivalents of useFetch
and useAsyncData
with lazy
option.lazy
option.await
if using lazy
fetch methods, but including it doesn’t affect functionality.lazy
fetch methods and UI improvements enhance UX.nuxt-loading-indicator
, NuSkeleton
, and lazy methods.