Nuxt/test/fixtures/basic/pages/await-async-data.vue

18 lines
262 B
Vue
Raw Normal View History

2016-12-27 15:31:25 +00:00
<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>