Nuxt/test/fixtures/children/pages/parent.vue

24 lines
357 B
Vue
Raw Normal View History

2016-12-20 17:05:39 +00:00
<template>
<div>
2017-08-25 10:24:39 +00:00
<h1>I am the {{ name }}</h1>
<NuxtChild />
2016-12-20 17:05:39 +00:00
</div>
</template>
2017-08-25 10:24:39 +00:00
<script>
export default {
async asyncData ({ route }) {
2017-10-31 13:26:19 +00:00
const asyncData = {}
2017-08-25 10:24:39 +00:00
await new Promise((resolve, reject) => {
setTimeout(() => {
asyncData.name = 'parent'
2017-10-31 13:26:19 +00:00
resolve()
2017-08-25 10:24:39 +00:00
}, 100)
2017-10-31 13:26:19 +00:00
})
2017-08-25 10:24:39 +00:00
2017-10-31 13:26:19 +00:00
return asyncData
2017-08-25 10:24:39 +00:00
}
}
</script>