Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IFormFieldPropsBase<Value>

Type parameters

  • Value

Hierarchy

  • {}
  • {}
    • IFormFieldPropsBase

Index

Properties

Optional after

after: React.ReactNode

在表单项后面显示的自定义内容

Optional before

before: React.ReactNode

在表单项前面显示的自定义内容

Optional format

format: (value: Value) => Value

渲染前会先经过 format

Type declaration

    • (value: Value): Value
    • Parameters

      • value: Value

      Returns Value

Optional getValidateOption

getValidateOption: (source: "blur" | "change") => ValidateOption | undefined

根据触发校验的源头获取校验规则

param

校验触发的来源

returns

校验规则执行的选项 https://zent-contrib.github.io/formulr/enums/validateoption.html

Type declaration

Optional helpDesc

helpDesc: React.ReactNode

表单项说明文案

Optional modelRef

modelRef: RefObject<FieldModel<Value>>

Optional normalize

normalize: (value: Value, prevValue: Value) => Value

触发onChange时会先经过 normalize 再写入到内部的 model

Type declaration

    • (value: Value, prevValue: Value): Value
    • Parameters

      • value: Value
      • prevValue: Value

      Returns Value

Optional notice

notice: React.ReactNode

表单项警示性文案

Optional renderError

renderError: IRenderError<Value>

自定义错误渲染,参数是 validator 返回的对象,一次只会有一个错误

Optional required

required: boolean | string

是否必填,如果这项有值,会在校验规则里添加一个 required 规则

Optional touchWhen

touchWhen: TouchWhen

什么时候标记表单项为 touched

defaultvalue

TouchWhen.Change

Optional validateOccasion

validateOccasion: ValidateOccasion

什么时候触发校验

defaultvalue

ValidateOccasion.Change | ValidateOccasion.Blur

Optional withoutError

withoutError: boolean

设置不显示错误

Generated using TypeDoc