2022-03-30 15:59:28 +00:00
|
|
|
---
|
2022-10-06 09:15:30 +00:00
|
|
|
toc: false
|
2022-03-30 15:59:28 +00:00
|
|
|
---
|
|
|
|
|
2022-11-08 17:03:18 +00:00
|
|
|
# useAsyncData
|
|
|
|
|
|
|
|
This example shows how to use useAsyncData to fetch data from an API endpoint.
|
|
|
|
|
2022-03-30 15:59:28 +00:00
|
|
|
::alert{type=info icon=💡}
|
2022-04-16 13:53:36 +00:00
|
|
|
Nuxt will automatically read files in the `~/server/api` directory to create API endpoints.
|
2022-03-30 15:59:28 +00:00
|
|
|
::
|
|
|
|
|
2022-11-16 10:04:28 +00:00
|
|
|
::ReadMore{link="/docs/api/composables/use-async-data"}
|
2022-04-06 05:56:08 +00:00
|
|
|
::
|
|
|
|
|
2022-11-16 10:04:28 +00:00
|
|
|
::ReadMore{link="/docs/getting-started/data-fetching"}
|
2022-03-30 15:59:28 +00:00
|
|
|
::
|
|
|
|
|
2023-01-19 19:37:07 +00:00
|
|
|
::sandbox{repo="nuxt/nuxt" branch="main" dir="examples/composables/use-async-data" file="app.vue"}
|
2022-10-06 09:15:30 +00:00
|
|
|
::
|