推进、完成与重新开始
默认 linear 逐步推进;完成过的位置可从标题返回,未来位置通过 next 前进。索引从 0 开始,items.length 表示流程结束;complete 仅通知到达结束位置,不代表服务端业务已成功。actions 插槽自由组合已有 Button,不限定操作顺序。
自由选择与受控状态
linear=false 允许选择任意可用步骤;v-model 由宿主管理。标题是原生按钮,使用 Tab 移动焦点,Enter/Space 激活。步骤导航不冒充页签,不承诺方向键切换。
校验与保留草稿
isStepValid 是同步判断;不通过时触发 invalid 并停留,error 文本提供恢复说明。示例聚焦未填写的输入,成功后聚焦新标题。所有步骤内容保持挂载,仅隐藏非当前区域,后退不会因为内容销毁而丢失草稿。
异步失败与恢复
宿主执行异步校验或提交,busy 期间暂停导航。成功后显式更新位置;失败保持当前任务与恢复说明。组件不发请求,不自动判定业务成功,也不把步骤数解释为后台处理百分比。
禁用与可用路径
整组 disabled 暂停所有导航;单项 disabled 保留标题及 disabledReason,但不能进入。下一位置不可用时不会自动跳过;宿主负责安排合法流程。权限是业务规则,步骤状态不是权限校验替代品。
方向与密度
density="compact|comfortable" 调整步骤间距和指示器,操作按钮仍使用自己的 size。orientation="vertical" 适合窄侧栏或长说明;横向空间不足时可滚动。
长内容、动态数据与阅读方向
名称和说明完整换行,RTL 由 LocaleProvider 和宿主方向共同控制。空数组呈现空态,不报告完成;索引越界时投影到有效范围。items 使用稳定 key,重排时宿主同步更新当前索引,避免相同位置被误当作同一任务。
API
QuireSteps Props
Slots 内容位置
indicatorStatic indicator content inside the title button.
{ /** Original host item. */ item: { /** Stable identity, unique within the sequence. */ key: string; /** Visible step name. */ title: string; /** Supporting task guidance. */ description?: undefined | string; /** Visible error and recovery guidance, independent of position. */ error?: string | undefined; /** Prevent navigation to this step; never implicitly skip it. */ disabled?: boolean | undefined; /** Visible explanation of the unavailable step. */ disabledReason?: string | undefined; }; /** Zero-based item position. */ index: number; /** Whether this is the currently visible step. */ current: boolean; /** Whether this position precedes the current step. */ completed: boolean; }contentMounted content for every step, hidden while inactive.
{ /** Original host item. */ item: { /** Stable identity, unique within the sequence. */ key: string; /** Visible step name. */ title: string; /** Supporting task guidance. */ description?: undefined | string; /** Visible error and recovery guidance, independent of position. */ error?: string | undefined; /** Prevent navigation to this step; never implicitly skip it. */ disabled?: boolean | undefined; /** Visible explanation of the unavailable step. */ disabledReason?: string | undefined; }; /** Zero-based item position. */ index: number; /** Whether this is the currently visible step. */ current: boolean; /** Whether this position precedes the current step. */ completed: boolean; }completedFinal task result; hosts arrange focus after successful submission.
anyactionsCompose existing Buttons freely using the public controls.
{ /** Current normalized position. */ index: number; /** Whether the next position is available; validation runs upon activation. */ canNext: boolean; /** Whether the previous position is available. */ canPrevious: boolean; /** Whether a nonempty sequence reached its ending position. */ completed: boolean; /** Request the next step or the completed position. */ next: { (): void; }; /** Request the previous position without discarding drafts. */ previous: { (): void; }; /** Request a permitted title-navigation target. */ goTo: { (index: number): void; }; /** Return to the first step; the host owns clearing business data. */ reset: { (): void; }; }
Events 组件事件
update:modelValue更新
modelValue,可通过对应 v-model 绑定。[index: number]complete[]invalid[index: number]
公开实例成员
next() => voidprevious() => voidgoTo(index: number) => voidreset() => voidcanNextbooleancanPreviousbooleancompletedboolean