Nuxt/test/fixtures/basic/pages/await-async-data.vue
pooya parsa e7cc2757c3 refactor: update eslint-config to 1.x
Co-authored-by: Alexander Lichter <manniL@gmx.net>
2019-07-10 15:15:49 +04:30

19 lines
291 B
Vue

<template>
<p>{{ name }}</p>
</template>
<script>
const fetchData = () => {
return new Promise((resolve) => {
setTimeout(() => resolve({ name: 'Await Nuxt.js' }), 10)
})
}
export default {
async asyncData () {
const data = await fetchData()
return data
}
}
</script>