Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
/frameworkPublic archive
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/content/2.guide/2.features/5.data-fetching.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -118,13 +118,13 @@ watch(posts, (newPosts) => {

Sometimes throughout the course of your user's page visit, you may need to refresh the data loaded from the API. This can happen if the user chooses to paginate, filter results, search, etc.

You can make use of the `refresh()` method returned from the `useAsyncData()` composable to refresh the data with different query parameters:
You can make use of the `refresh()` method returned from the `useFetch()` composable to refresh the data with different query parameters:

```vue
<script setup>
const page = ref(1);

const { data:users, loading, refresh, error } = await useFetch(() => `users?page=${page.value}&take=6`, { baseURL: config.API_BASE_URL }
const { data:users, pending, refresh, error } = await useFetch(() => `users?page=${page.value}&take=6`, { baseURL: config.API_BASE_URL }
);

function previous(){
Expand Down