B 树查找 <BTreeIndex />
按层画出索引页和键,查找经过的页加强调色描边,命中的键反色;右栏每层一句说明。
Template and style descriptions are currently available in Chinese only.
- Group
- 技术 · 索引 · 查找路径
- Component
BTreeIndex·#btree-index- Interaction
- build 模式下每按一次 → 往下走一层
Good for
- 讲 B-tree、跳表、分层目录这类逐层缩小范围的查找
- 要讲清“为什么快”
Avoid when
- 超过 3 层或每层超过 4 页
- 不是查找过程,只是层级:用 Pyramid 或 IssueTree
Content limits
| 1 | levels 2–3 层;每层 ≤ 4 页;每页 1–4 个键,每个 ≤ 5 个字符 |
| 2 | target ≤ 8 个字符 |
| 3 | notes 每层一句,≤ 30 字 |
| 4 | leafNote ≤ 24 字 |
Fields
| Field | Type | |
|---|---|---|
kicker · required | string | 标题上方的小节名,2–8 字 |
title · required | string | string[] | 页面标题;传数组可手动断行,每项一行 |
lead | string | 一到两句导语,≤ 60 字 |
source | string | 事实出处;页面上有任何数据或事实时必填 |
hint | ReactNode | 页眉中间的操作提示,可用 <kbd> |
levels · required | string[][][] | 层 → 页 → 键 |
path · required | number[] | 每层经过的页序号 |
target · required | string | 要查的键 |
notes | string[] | 每层一句说明 |
leafNote | string | 底部说明 |
Example
<BTreeIndex kicker="索引" title="…" target="42" levels={[[['30', '60']], [['10', '20'], ['40', '50'], ['70', '80']]]} path={[0, 1]} />