Skip to content

Commit

Permalink
gitbook 添加目录
Browse files Browse the repository at this point in the history
  • Loading branch information
tangly1024 committed Jul 5, 2024
1 parent 4535dec commit 9790bae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions themes/gitbook/components/Catalog.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useGlobal } from '@/lib/global'
import { isBrowser } from '@/lib/utils'
import throttle from 'lodash.throttle'
import { uuidToId } from 'notion-utils'
Expand All @@ -13,6 +14,7 @@ const Catalog = ({ post }) => {
const toc = post?.toc
// 同步选中目录事件
const [activeSection, setActiveSection] = useState(null)
const {locale}= useGlobal()

// 监听滚动事件
useEffect(() => {
Expand Down Expand Up @@ -67,6 +69,7 @@ const Catalog = ({ post }) => {

return (
<>
<div className='w-full'><i className='mr-1 fas fa-stream' />{locale.COMMON.TABLE_OF_CONTENTS}</div>
<div
id='toc-wrapper'
className='toc-wrapper overflow-y-auto my-2 max-h-80 overscroll-none scroll-hidden'>
Expand Down

0 comments on commit 9790bae

Please sign in to comment.