Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
Update docs/content/3.api/3.utils/define-nuxt-component.md
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Roe <daniel@roe.dev>
  • Loading branch information
pi0 and danielroe committed Sep 20, 2022
1 parent 0acbff1 commit 586bbe3
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions docs/content/3.api/3.utils/define-nuxt-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,3 @@ export default defineNuxtComponent({
})
</script>
```

## `setup` function

`defineNuxtComponent()` also takes care of resolving the promise returned by `useAsyncData()` in Vue components found at `components/` and `pages/` directory, or in the `~/app.vue` component found at the root of your Nuxt application:

```vue [pages/index.vue]
<script lang="ts">
export default defineNuxtComponent({
async setup(props) {
const { data } = await useAsyncData(() => Promise.resolve('Hello world!'))
return {
data
}
}
})
</script>
```

0 comments on commit 586bbe3

Please sign in to comment.