iter(g111): 面包屑支持超长路径折叠

This commit is contained in:
HIsheR
2026-10-26 14:04:40 +08:00
parent f90033707c
commit f40ef6d3ea
8 changed files with 91 additions and 18 deletions
+7 -1
View File
@@ -706,6 +706,11 @@
"t": "(item, index) => void",
"k": 1,
"d": "无 href 条目的点击回调"
},
{
"n": "maxItems",
"t": "number",
"d": "最多展示几项:超出时首项之后折叠成「…」按钮(aria-label 报出折叠条数),点开即完整展开;缺省不折叠"
}
],
"example": "breadcrumb({ items: [{ label: '首页', href: '/' }, { label: '设置' }, { label: '账户' }], onNavigate: (it) => console.log(it.label) })",
@@ -713,7 +718,8 @@
"按层级顺序准备 items,最后一项即当前页,自动渲染为不可点的灰色文字并带 aria-current='page'",
"需要真实跳转就给条目加 href(渲染 <a>);单页应用想自行接管时不给 href,改用 onNavigate 回调",
"改分隔符传 separator,如 '›';分隔符对读屏隐藏",
"语义结构为 nav + ol + li,可直接放进页头或卡片标题栏"
"语义结构为 nav + ol + li,可直接放进页头或卡片标题栏",
"路径过深时传 maxItems(如 4):首项 + 「…」+ 末几项,点「…」原地展开全部,末项始终是当前页"
]
},
{