mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
docs: add additional type generics to useFetch
docs (#22755)
Co-authored-by: 李杰 <ajay.li@feisu.com>
This commit is contained in:
parent
a2f2a4748e
commit
60c1eec047
@ -10,12 +10,12 @@ It automatically generates a key based on URL and fetch options, provides type h
|
||||
## Type
|
||||
|
||||
```ts [Signature]
|
||||
function useFetch(
|
||||
function useFetch<DataT, ErrorT>(
|
||||
url: string | Request | Ref<string | Request> | () => string | Request,
|
||||
options?: UseFetchOptions<DataT>
|
||||
): Promise<AsyncData<DataT>>
|
||||
): Promise<AsyncData<DataT, ErrorT>>
|
||||
|
||||
type UseFetchOptions = {
|
||||
type UseFetchOptions<DataT> = {
|
||||
key?: string
|
||||
method?: string
|
||||
query?: SearchParams
|
||||
|
Loading…
Reference in New Issue
Block a user