Skip to content

Commit

Permalink
fix: #41 scroll to get next page data
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxy0551 committed Dec 2, 2024
1 parent 485bde3 commit 6f26e3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/article/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const Article = (data) => {
// 内容高度,180 是移动端顶部内容,318 是移动端名称图片内容,80 是 PC 端顶部内容,226 是 PC 端名称图片内容
const contentHeight = mobile ? (document.getElementById('articleContent')?.offsetHeight + 180 + 318) : (document.getElementById('articleContent')?.offsetHeight + 80 + 226)

if (hasMore && (scrollTop + windowHeight >= contentHeight)) {
if (hasMore && (scrollTop + windowHeight + 5 >= contentHeight)) {
console.log('下一页')
handleNext()
}
Expand Down

0 comments on commit 6f26e3d

Please sign in to comment.