Replace timeout with Vue ticks
This commit is contained in:
parent
3a3a834e14
commit
ba9772a0e0
|
@ -47,13 +47,12 @@ export default Vue.extend({
|
||||||
activeData() {
|
activeData() {
|
||||||
const scrollPos = window.scrollY || window.scrollTop || document.getElementsByTagName('html')[0].scrollTop
|
const scrollPos = window.scrollY || window.scrollTop || document.getElementsByTagName('html')[0].scrollTop
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
setTimeout(() => {
|
Vue.nextTick(() => {
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
// This is kinda ugly, but should fix a few existing issues
|
Vue.nextTick(() => {
|
||||||
setTimeout(() => {
|
|
||||||
window.scrollTo(0, scrollPos)
|
window.scrollTo(0, scrollPos)
|
||||||
}, 200)
|
})
|
||||||
}, 100)
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
|
|
Loading…
Reference in New Issue