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 18:42:26 +00:00
|
|
|
this.$nuxt.$loading.finish()
|
2018-08-06 00:12:44 +00:00
|
|
|
setTimeout(() => {
|
2018-08-06 18:42:26 +00:00
|
|
|
this.$nuxt.$loading.start()
|
|
|
|
this.loaded = true
|
2018-08-06 00:12:44 +00:00
|
|
|
}, 1500)
|
2018-08-05 21:56:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|