Nuxt/test/fixtures/basic/pages/await-async-data.vue
2017-03-01 16:03:46 +01:00

18 lines
267 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 () {
return await fetchData()
}
}
</script>