跳到主要内容

Steps

配置示例

解释说明:当form里的status为pendingApproval时,当前步骤为1,会取stepItems里title为"一级审批"进行显示

{
"component": "Steps",
"valueField": "status",
"style": {
"marginBottom": "80px"
},
"componentProps": {
"progressDot": false,
"size": "small",
"valueMap": {
"pendingApproval": 1,
"firstPass": 2,
"firstReject": 1,
"secondReject": 2,
"secondPass": 3
},
"stepItems": [
{
"title": "模型"
},
{
"title": "一级审批"
},
{
"title": "二级审批"
},
{
"title": "发布"
}
]
}
}

容器属性

所有组件配置的第一层均支持容器属性

组件属性 componentsProps

NameTypeDefault是否支持 Variable PatternDescription
classNamestring✔️组件的 className
styleobject组件的 style
currentnumber当前步骤的编号,步骤从 0 开始编号
status'wait' | 'process' | 'finish' | 'error'当前步骤的状态
direction'horizontal' | 'vertical''horizontal'方向
labelPlacement'horizontal' | 'vertical''vertical'Step title 和 description 的位置
itemsArray<ItemProps>antd steps 的属性
valueMapobject将 value 映射到 step 编号

所有其余 componentsProps 将会被传给组件根元素 div)。

ItemProps

NameTypeDefaultDescription
titlestring步骤的标题
descriptionstring步骤的描述
iconstring步骤的图标
hiddenConditionalPropertyPropType(bool)false

JS API

通过 formApi.getFieldApi() 获取的接口如下:

NameTypeDescription
nodeHTML Element组件的根 DOM 元素