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

21 lines
315 B
Vue
Raw Normal View History

2016-12-20 17:05:39 +00:00
<template>
2017-08-25 10:24:39 +00:00
<h2>Id={{ id }}</h2>
2016-12-20 17:05:39 +00:00
</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(() => {
2017-10-31 13:26:19 +00:00
asyncData.id = route.params.id
resolve()
2017-08-25 10:24:39 +00:00
}, 50)
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>