diff --git a/docs/1.getting-started/6.data-fetching.md b/docs/1.getting-started/6.data-fetching.md index d283ecc2db..47cb56f529 100644 --- a/docs/1.getting-started/6.data-fetching.md +++ b/docs/1.getting-started/6.data-fetching.md @@ -143,6 +143,26 @@ const { data: discounts, pending } = await useAsyncData('cart-discount', async ( Read more about `useAsyncData`. :: +## Return Values + +`useFetch` and `useAsyncData` have the same return values listed below. + +- `data`: the result of the asynchronous function that is passed in. +- `pending`: a boolean indicating whether the data is still being fetched. +- `refresh`/`execute`: a function that can be used to refresh the data returned by the `handler` function. +- `error`: an error object if the data fetching failed. +- `status`: a string indicating the status of the data request (`"idle"`, `"pending"`, `"success"`, `"error"`). + +::callout +`data`, `pending`, `error` and `status` are Vue refs accessible with `.value` in ` ``` +::callout +`data`, `pending`, `status` and `error` are Vue refs and they should be accessed with `.value` when used within the ` ``` +::callout +`data`, `pending`, `status` and `error` are Vue refs and they should be accessed with `.value` when used within the `