docs: deprecate pending and emphasis undefined (#28113)

This commit is contained in:
xjccc 2024-07-11 14:04:37 +08:00 committed by Daniel Roe
parent d864ba324b
commit 0ce16ac8c9
No known key found for this signature in database
GPG Key ID: 3714AB03996F442B
2 changed files with 4 additions and 1 deletions

View File

@ -157,7 +157,7 @@ Read more about `useAsyncData`.
- `data`: the result of the asynchronous function that is passed in. - `data`: the result of the asynchronous function that is passed in.
- `refresh`/`execute`: a function that can be used to refresh the data returned by the `handler` function. - `refresh`/`execute`: a function that can be used to refresh the data returned by the `handler` function.
- `clear`: a function that can be used to set `data` to undefined, set `error` to `null`, set `status` to `idle`, and mark any currently pending requests as cancelled. - `clear`: a function that can be used to set `data` to `undefined`, set `error` to `null`, set `status` to `idle`, and mark any currently pending requests as cancelled.
- `error`: an error object if the data fetching failed. - `error`: an error object if the data fetching failed.
- `status`: a string indicating the status of the data request (`"idle"`, `"pending"`, `"success"`, `"error"`). - `status`: a string indicating the status of the data request (`"idle"`, `"pending"`, `"success"`, `"error"`).

View File

@ -123,6 +123,9 @@ interface _NuxtApp {
/** @internal */ /** @internal */
_asyncData: Record<string, { _asyncData: Record<string, {
data: Ref<unknown> data: Ref<unknown>
/**
* @deprecated This may be removed in a future major version.
*/
pending: Ref<boolean> pending: Ref<boolean>
error: Ref<Error | DefaultAsyncDataErrorValue> error: Ref<Error | DefaultAsyncDataErrorValue>
status: Ref<AsyncDataRequestStatus> status: Ref<AsyncDataRequestStatus>