Nuxt/test/fixtures/basic/pages/await-async-data.vue
2016-12-27 16:31:25 +01:00

18 lines
262 B
Vue

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