React Bootstrap logoReact Bootstrap

TableOfContents

文档

目录组件,渲染可折叠的分级目录,支持锚点跳转与自定义链接渲染

Component Demo

Basic usage and examples of the TableOfContents component

基础用法

链接项与激活态

受控激活

API Documentation

Complete API reference for the TableOfContents component

Props

属性名类型默认值描述
activeTostring-当前激活的路由地址,用于高亮对应的链接项
itemsTocItem[]-目录项列表(必填)
onNavigate() => void-点击锚点或链接项后的回调
renderLinkRenderLink-自定义链接渲染函数,用于接入路由库
titlestring'目录'目录标题