diff --git a/src/views/HomepageView.vue b/src/views/HomepageView.vue index d2b247a..0de85b0 100644 --- a/src/views/HomepageView.vue +++ b/src/views/HomepageView.vue @@ -48,8 +48,7 @@ export default { } } }, - getNextCategory() { - window.onscroll = async () => { + async getNextCategory() { let bottomOfWindow = document.documentElement.scrollTop + window.innerHeight === document.documentElement.offsetHeight @@ -62,11 +61,10 @@ export default { this.data.push(category) } } - } } }, async mounted() { - this.getNextCategory() + window.onscroll = this.getNextCategory let following = localStorage.getItem('following') if (following) {