Nuxt/test/fixtures/fetch/pages/fetch-error.vue
renovate[bot] e934da3c36
chore(deps): update devdependency @nuxtjs/eslint-config to v5 (#8345)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Clark Du <clark.duxin@gmail.com>
2020-11-14 17:10:53 +00:00

25 lines
421 B
Vue

<template>
<div>
<p v-if="$fetchState.pending">
Fetching...
</p>
<p v-else-if="$fetchState.error" id="error">
{{ $fetchState.error.message }}
</p>
<pre v-else>{{ team }}</pre>
</div>
</template>
<script>
export default {
data () {
return {
team: []
}
},
async fetch () {
await new Promise((resolve, reject) => reject(new Error('fetch-error')))
}
}
</script>