mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
heo 桌面端下一页交互
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import Link from 'next/link'
|
||||
import { useRouter } from 'next/router'
|
||||
import { useEffect, useState } from 'react'
|
||||
import CONFIG from '../config'
|
||||
|
||||
@@ -9,6 +10,11 @@ import CONFIG from '../config'
|
||||
*/
|
||||
export default function ArticleAdjacent({ prev, next }) {
|
||||
const [isScrollEnd, setIsScrollEnd] = useState(false)
|
||||
const router = useRouter()
|
||||
|
||||
useEffect(() => {
|
||||
setIsScrollEnd(false)
|
||||
}, [router])
|
||||
|
||||
useEffect(() => {
|
||||
// 文章是否已经到了底部
|
||||
@@ -18,8 +24,6 @@ export default function ArticleAdjacent({ prev, next }) {
|
||||
entries.forEach((entry) => {
|
||||
if (entry.isIntersecting) {
|
||||
setIsScrollEnd(true)
|
||||
} else {
|
||||
// setIsScrollEnd(false)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user