Fix scrolling
This commit is contained in:
parent
d88f7ab1d9
commit
7845004840
|
@ -59,11 +59,8 @@
|
|||
.then(() => {
|
||||
item._is_read = true
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
window.onscroll = () => {
|
||||
},
|
||||
handleScroll() {
|
||||
// let bottomOfWindow = document.documentElement.scrollTop + window.innerHeight === document.documentElement.offsetHeight;
|
||||
let bottomOfWindow = document.documentElement.scrollTop + window.innerHeight === this.$el.offsetHeight + document.documentElement.offsetHeight + 20;
|
||||
if (bottomOfWindow) {
|
||||
|
@ -94,6 +91,14 @@
|
|||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
window.addEventListener('scroll', this.handleScroll);
|
||||
},
|
||||
|
||||
destroyed() {
|
||||
window.removeEventListener('scroll', this.handleScroll);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue
Block a user