docs: add additional type generics to useFetch docs (#22755)

Co-authored-by: 李杰 <ajay.li@feisu.com>
This commit is contained in:
eternalltruth 2023-08-23 15:46:44 +08:00 committed by GitHub
parent a2f2a4748e
commit 60c1eec047
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,12 +10,12 @@ It automatically generates a key based on URL and fetch options, provides type h
## Type ## Type
```ts [Signature] ```ts [Signature]
function useFetch( function useFetch<DataT, ErrorT>(
url: string | Request | Ref<string | Request> | () => string | Request, url: string | Request | Ref<string | Request> | () => string | Request,
options?: UseFetchOptions<DataT> options?: UseFetchOptions<DataT>
): Promise<AsyncData<DataT>> ): Promise<AsyncData<DataT, ErrorT>>
type UseFetchOptions = { type UseFetchOptions<DataT> = {
key?: string key?: string
method?: string method?: string
query?: SearchParams query?: SearchParams