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,
|
2019-07-10 10:45:49 +00:00
|
|
|
asyncData () {
|
2018-08-05 21:56:49 +00:00
|
|
|
return new Promise((resolve) => {
|
2018-08-06 00:12:44 +00:00
|
|
|
setTimeout(() => resolve({
|
|
|
|
loaded: false,
|
|
|
|
name: 'Nuxt.js'
|
2018-09-18 16:16:27 +00:00
|
|
|
}), 300)
|
2018-08-05 21:56:49 +00:00
|
|
|
})
|
|
|
|
},
|
2019-07-10 10:45: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>
|