iter(g165): 步骤条支持竖向排列

This commit is contained in:
HIsheR
2026-10-26 16:11:06 +08:00
parent dddbccd97d
commit 804ab3b18f
7 changed files with 64 additions and 7 deletions
+3 -1
View File
@@ -1,6 +1,6 @@
# @ui-arch 组件库 Agent 文档(无图形版)
> 自动生成于 2026-10-26T08:09:26.855Z,数据源:各包 ua.manifest.json,勿手改。人类版文档站:apps/docs/index.html。
> 自动生成于 2026-10-26T08:10:50.397Z,数据源:各包 ua.manifest.json,勿手改。人类版文档站:apps/docs/index.html。
> 组件 = 普通函数,传 props 返回 DOM;状态用 signal 双向绑定:读 signal() 写 signal(v)。
## 快速上手
@@ -725,6 +725,7 @@ const tab = signal('a'); tabs({ tabs: [{ value: 'a', label: '概览', closable:
- steps(必填):StepperItem[] —— 步骤列表,每项 { label, description? }
- active(必填):Signal<number> —— 当前步索引(0 基)信号,双向绑定:回跳写回、外部赋值同步
- clickable:boolean —— 已完成步骤是否可点击回跳;缺省 false
- direction(默认 'horizontal'):'horizontal' | 'vertical' —— 排列方向:horizontal 横排连接线在节点之间;vertical 竖排、连接线落在圆点下方,已走完的一段用主色
- onChange(回调):(index: number) => void —— 步骤切换回调(点击回跳触发)
示例:
@@ -738,6 +739,7 @@ const step = signal(1); stepper({ steps: [{ label: '下单' }, { label: '支付'
1. 用 signal(0) 创建当前步索引,传入 active;索引之前的步骤显示 ✓ 已完成态
2. 流程推进时外部赋值即可:step(step() + 1),组件三态自动跟随
3. clickable: true 时已完成步骤可点击回跳并写回信号,配合 onChange 同步业务状态
4. 侧栏或移动端传 direction: 'vertical':圆点成一列、说明文字紧贴右侧,步与步之间由圆点下方的竖线相连(末步不画线,已完成的段用主色标进度)
现场演示:apps/docs/demo.html#sec-stepper