Skip to content

Commit 6f26e3d

Browse files
committed
fix: #41 scroll to get next page data
1 parent 485bde3 commit 6f26e3d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pages/article/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ const Article = (data) => {
112112
// 内容高度,180 是移动端顶部内容,318 是移动端名称图片内容,80 是 PC 端顶部内容,226 是 PC 端名称图片内容
113113
const contentHeight = mobile ? (document.getElementById('articleContent')?.offsetHeight + 180 + 318) : (document.getElementById('articleContent')?.offsetHeight + 80 + 226)
114114

115-
if (hasMore && (scrollTop + windowHeight >= contentHeight)) {
115+
if (hasMore && (scrollTop + windowHeight + 5 >= contentHeight)) {
116116
console.log('下一页')
117117
handleNext()
118118
}

0 commit comments

Comments
 (0)