2018-03-14 00:14:57 +00:00
|
|
|
{{#if revealed}}
|
|
|
|
<:Component {pageComponent} :params />
|
|
|
|
{{/if}}
|
|
|
|
<script>
|
2018-04-14 22:50:53 +01:00
|
|
|
// On the very first page load, avoid doing a "reveal" because
|
|
|
|
// it leads to a flash between when the SSR is shown, the two frame we hide it,
|
|
|
|
// and then when we show it again.
|
|
|
|
//
|
|
|
|
// We only really need LazyPage behavior when the user is clicking around
|
|
|
|
// after the page has loaded, to improve input responsiveness.
|
|
|
|
let firstTime = true
|
|
|
|
|
2018-03-14 00:14:57 +00:00
|
|
|
export default {
|
2018-04-20 02:42:29 +01:00
|
|
|
oncreate () {
|
2018-04-14 22:50:53 +01:00
|
|
|
firstTime = false
|
2018-03-28 03:46:01 +01:00
|
|
|
requestAnimationFrame(() => {
|
|
|
|
requestAnimationFrame(() => {
|
|
|
|
this.set({revealed: true})
|
|
|
|
})
|
|
|
|
})
|
2018-03-14 00:14:57 +00:00
|
|
|
},
|
|
|
|
data: () => ({
|
2018-04-14 22:50:53 +01:00
|
|
|
revealed: !process.browser || firstTime
|
2018-03-14 00:14:57 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
</script>
|