mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
e934da3c36
Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Clark Du <clark.duxin@gmail.com>
24 lines
407 B
Vue
24 lines
407 B
Vue
<template>
|
|
<div>
|
|
<p v-if="$fetchState.pending">
|
|
Fetching...
|
|
</p>
|
|
<pre v-else>{{ team }}</pre>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data () {
|
|
return {
|
|
team: []
|
|
}
|
|
},
|
|
async fetch () {
|
|
const url = (process.server ? `http://${this.$ssrContext.req.headers.host}` : '')
|
|
|
|
this.team = await fetch(`${url}/team.json`).then(res => res.json())
|
|
}
|
|
}
|
|
</script>
|