mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-16 21:58:19 +00:00
docs(api): add watch parameter in useFetch
options (#5562)
Co-authored-by: 井上裕貴 <inoueyuki@inoueyukinoMacBook-Pro.local>
This commit is contained in:
parent
de3b4084a5
commit
1b6289f60f
@ -22,6 +22,7 @@ type UseFetchOptions = {
|
|||||||
default?: () => DataT
|
default?: () => DataT
|
||||||
transform?: (input: DataT) => DataT
|
transform?: (input: DataT) => DataT
|
||||||
pick?: string[]
|
pick?: string[]
|
||||||
|
watch?: WatchSource[]
|
||||||
}
|
}
|
||||||
|
|
||||||
type DataT = {
|
type DataT = {
|
||||||
@ -47,6 +48,7 @@ type DataT = {
|
|||||||
* `server`: Whether to fetch the data on the server (defaults to `true`).
|
* `server`: Whether to fetch the data on the server (defaults to `true`).
|
||||||
* `default`: A factory function to set the default value of the data, before the async function resolves - particularly useful with the `lazy: true` option.
|
* `default`: A factory function to set the default value of the data, before the async function resolves - particularly useful with the `lazy: true` option.
|
||||||
* `pick`: Only pick specified keys in this array from the `handler` function result.
|
* `pick`: Only pick specified keys in this array from the `handler` function result.
|
||||||
|
* `watch`: watch reactive sources to auto-refresh
|
||||||
* `transform`: A function that can be used to alter `handler` function result after resolving.
|
* `transform`: A function that can be used to alter `handler` function result after resolving.
|
||||||
|
|
||||||
## Return values
|
## Return values
|
||||||
|
Loading…
Reference in New Issue
Block a user