docs: fix data fetching example (#1615)

This commit is contained in:
Acidiney Dias 2021-11-02 10:36:01 +01:00 committed by GitHub
parent 348c82d55a
commit 8838cc7192
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,8 +129,8 @@ Using `<script setup>` is recommended, as it removes the limitation of using top
export default defineComponent({
async setup() {
const [{ data: organization }, { data: repos }] = await Promise.all([
useFetch(`https://api.github.com/orgs/nuxtjs`),
useFetch(`https://api.github.com/orgs/nuxtjs/repos`)
useFetch(`https://api.github.com/orgs/nuxt`),
useFetch(`https://api.github.com/orgs/nuxt/repos`)
])
return {
@ -139,9 +139,12 @@ export default defineComponent({
}
}
})
</script>
<template>
<h1>{{ mountain.title }}</h1>
<p>{{ mountain.description }}</p>
<header>
<h1>{{ organization.login }}</h1>
<p>{{ organization.description }}</p>
</header>
</template>
```