Skip to content

Commit

Permalink
docs: fix api examples (nuxt#4870)
Browse files Browse the repository at this point in the history
  • Loading branch information
salimabsi authored May 9, 2022
1 parent b633a9c commit c0f0670
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/content/2.guide/2.features/5.data-fetching.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ The example below adds the request headers to an isomorphic `fetch` call to ensu

```vue
<script setup>
const { data } = useFetch('/api/me', {
const { data } = await useFetch('/api/me', {
headers: useRequestHeaders(['cookie'])
})
</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/content/3.api/1.composables/use-fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ By default, Nuxt waits until a `refresh` is finished before it can be executed a
## Example
```ts
const { data, pending, error, refresh } = useFetch(
const { data, pending, error, refresh } = await useFetch(
'https://api.nuxtjs.dev/mountains',
{
pick: ['title']
Expand Down
2 changes: 1 addition & 1 deletion docs/content/3.api/1.composables/use-route.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Within the template of a Vue component, you can access the route using `$route`.

## Example

In the following example, we call an API via `useAsyncData` using a dynamic page parameter - `slug` - as part of the URL.
In the following example, we call an API via `useFetch` using a dynamic page parameter - `slug` - as part of the URL.

```html [~/pages/[slug].vue]
<script setup>
Expand Down

0 comments on commit c0f0670

Please sign in to comment.