Skip to content

FormStep

分步表单组件

注意

该组件只适用于 Schema 场景。

Markup Schema 案例

提示

通过createFormStep创建出来的对象属于@formily/reactive的响应式,在例子中通过FormConsumer包裹才实现了渲染的更新。

JSON Schema 案例

API

FormStep

属性名类型描述默认值
formStepIFormStep传入通过 createFormStep 创建出来的模型

其余参考 https://cn.element-plus.org/zh-CN/component/steps.html

FormStep.StepPane

参考 https://cn.element-plus.org/zh-CN/component/steps.html

FormStep.createFormStep

ts
interface createFormStep {
  (current?: number): IFormStep
}

interface IFormStep {
  // 当前索引
  current: number
  // 是否允许向后
  allowNext: boolean
  // 是否允许向前
  allowBack: boolean
  // 设置当前索引
  setCurrent: (key: number) => void
  // 提交表单
  submit: Formily.Core.Models.Form['submit']
  // 向后
  next: () => void
  // 向前
  back: () => void
}