remove page flash due to LazyPage.html (#120)
This commit is contained in:
parent
29c38c1f83
commit
a6e737bdbb
|
@ -2,8 +2,17 @@
|
||||||
<:Component {pageComponent} :params />
|
<:Component {pageComponent} :params />
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<script>
|
<script>
|
||||||
|
// 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
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
oncreate() {
|
oncreate() {
|
||||||
|
firstTime = false
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
this.set({revealed: true})
|
this.set({revealed: true})
|
||||||
|
@ -11,7 +20,7 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
revealed: !process.browser
|
revealed: !process.browser || firstTime
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
Loading…
Reference in New Issue