Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #41 scroll to get next page data #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: #41 scroll to get next page data
liuxy0551 committed Dec 2, 2024
commit 6f26e3d56a48411a2bc927ba367df352dc33c761
2 changes: 1 addition & 1 deletion src/pages/article/index.tsx
Original file line number Diff line number Diff line change
@@ -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()
}