docs: add cache option to useFetch params (#27225)

This commit is contained in:
Jakub Bednár 2024-05-15 12:51:47 +02:00 committed by GitHub
parent 06be4cc025
commit 855292f363
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -87,6 +87,8 @@ Watch the video from Alexander Lichter to avoid using `useFetch` the wrong way!
- `headers`: Request headers. - `headers`: Request headers.
- `baseURL`: Base URL for the request. - `baseURL`: Base URL for the request.
- `timeout`: Milliseconds to automatically abort request - `timeout`: Milliseconds to automatically abort request
- `cache`: Handles cache control according to [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/fetch#cache)
- You can pass boolean to disable the cache or you can pass one of the following values: `default`, `no-store`, `reload`, `no-cache`, `force-cache`, and `only-if-cached`.
::note ::note
All fetch options can be given a `computed` or `ref` value. These will be watched and new requests made automatically with any new values if they are updated. All fetch options can be given a `computed` or `ref` value. These will be watched and new requests made automatically with any new values if they are updated.