Skip to content
On this page

EzForm Component API

Props

NameDescriptionType
nameForm's namestring
formA FormInstance to control form from outsideFormInstance
initialValuesInitial values for form dataRecord<string, any>
rulesValidation rulesRules
validateTriggerConfig field validate triggerValidateTrigger | ValidateTrigger[]
validateMessagesCustom validation messagesValidateMessages
classPrefixCustom class prefix to generate form's classstring
preserveValuesKeep field value even when field removedboolean

Events

NameDescriptionType
onSubmitTrigger after submitting the form and validating data successfully(values: any) => void
onErrorTrigger after submitting the form and validating data failed(errors: ValidateError[]) => void
onChangeTrigger when value updated(values: any) => void

Scoped slot - Default

NameDescriptionType
valuesForm's valuesany
errorsForm's errorsValidateError[]
dirtyDetermine if form is dirtyboolean
submitFunction to submit formFormInstance['submit']
resetFunction to reset form's data and stateFormInstance['reset']
validateFunction to reset validate form's dataFormInstance['validate']
getFieldValueFunction to get form's field dataFormInstance['getFieldValue']
setFieldValueFunction to set form's field dataFormInstance['setFieldValue']
isDirtyFunction to check if form's field is dirtyFormInstance['isDirty']

EzForm