From 7b3dc6ec5db92c843f6d1e58e0b55dde63ce16b1 Mon Sep 17 00:00:00 2001 From: "L.Rain" Date: Tue, 24 May 2022 22:20:52 +0800 Subject: [PATCH] docs(api): add `key` option for `useFetch` (#5089) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sébastien Chopin --- docs/content/3.api/1.composables/use-fetch.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/content/3.api/1.composables/use-fetch.md b/docs/content/3.api/1.composables/use-fetch.md index 1bb036f5a4..b1d4256066 100644 --- a/docs/content/3.api/1.composables/use-fetch.md +++ b/docs/content/3.api/1.composables/use-fetch.md @@ -11,6 +11,7 @@ function useFetch( ): Promise type UseFetchOptions = { + key?: string, method?: string, params?: SearchParams, body?: RequestInit['body'] | Record @@ -41,6 +42,7 @@ type DataT = { * `headers`: Request headers * `baseURL`: Base URL for the request * **Options (from `useAsyncData`)**: + * `key`: a unique key to ensure that data fetching can be properly de-duplicated across requests, if not provided, it will be generated based on the `url` and fetch options * `lazy`: Whether to resolve the async function after loading the route, instead of blocking navigation (defaults to `false`). * `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.