2018-08-05 21:56:49 +00:00
|
|
|
<template>
|
2018-08-06 00:12:44 +00:00
|
|
|
<div>
|
|
|
|
<h1>{{ name }}</h1>
|
|
|
|
<p>{{ loaded }}</p>
|
|
|
|
</div>
|
2018-08-05 21:56:49 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
loading: false,
|
|
|
|
asyncData() {
|
|
|
|
return new Promise((resolve) => {
|
2018-08-06 00:12:44 +00:00
|
|
|
setTimeout(() => resolve({
|
|
|
|
loaded: false,
|
|
|
|
name: 'Nuxt.js'
|
|
|
|
}), 10)
|
2018-08-05 21:56:49 +00:00
|
|
|
})
|
|
|
|
},
|
|
|
|
mounted() {
|
2018-08-06 00:12:44 +00:00
|
|
|
setTimeout(() => {
|
|
|
|
this.$nuxt.$loading.finish()
|
|
|
|
setTimeout(() => {
|
|
|
|
// Re-enable loader as we move on
|
|
|
|
// to normal pages in the test
|
|
|
|
this.$nuxt.$loading.start()
|
|
|
|
this.loaded = true
|
|
|
|
}, 1500)
|
|
|
|
}, 1500)
|
2018-08-05 21:56:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|