mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-18 15:09:34 +00:00
hook-checks
This commit is contained in:
@@ -11,10 +11,6 @@ import Progress from './Progress'
|
||||
* @constructor
|
||||
*/
|
||||
const Toc = ({ toc }) => {
|
||||
// 无目录就直接返回空
|
||||
if (!toc || toc.length < 1) {
|
||||
return <></>
|
||||
}
|
||||
// 监听滚动事件
|
||||
React.useEffect(() => {
|
||||
window.addEventListener('scroll', actionSectionScrollSpy)
|
||||
@@ -58,6 +54,11 @@ const Toc = ({ toc }) => {
|
||||
tRef?.current?.scrollTo({ top: 28 * index, behavior: 'smooth' })
|
||||
}, throttleMs))
|
||||
|
||||
// 无目录就直接返回空
|
||||
if (!toc || toc.length < 1) {
|
||||
return <></>
|
||||
}
|
||||
|
||||
return <div className='px-3'>
|
||||
<div className='w-full pb-1'>
|
||||
<Progress />
|
||||
|
||||
Reference in New Issue
Block a user