Nuxt/test/fixtures/fetch/pages/fetch-error.vue
2020-02-04 19:36:22 +01: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 {
async fetch () {
await new Promise((resolve, reject) => reject(new Error('fetch-error')))
},
data () {
return {
team: []
}
}
}
</script>