mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-21 17:37:29 -07:00
a
This commit is contained in:
parent
818eb47663
commit
eacf726043
1 changed files with 3 additions and 6 deletions
|
@ -71,18 +71,15 @@ defineExpose({
|
||||||
scrollTop,
|
scrollTop,
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchedRecently = ref(false);
|
const lastFetchPos = ref(0);
|
||||||
|
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
if (!tlEl.value || fetchedRecently.value) return;
|
if (!tlEl.value) return;
|
||||||
const viewport = document.documentElement.clientHeight;
|
const viewport = document.documentElement.clientHeight;
|
||||||
const left = document.documentElement.scrollHeight - document.documentElement.scrollTop;
|
const left = document.documentElement.scrollHeight - document.documentElement.scrollTop;
|
||||||
if (left <= viewport * 3) {
|
if (left <= viewport * 3) {
|
||||||
pagingComponent.value.fetchMore();
|
pagingComponent.value.fetchMore();
|
||||||
fetchedRecently.value = true;
|
lastFetchPos.value = document.documentElement.scrollTop;
|
||||||
setTimeout(() => {
|
|
||||||
fetchedRecently.value = false;
|
|
||||||
}, 500);
|
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue