Skip to content

Auto Binding

In this page, we will explain how auto binding works in Ez Form.

Updating data

Ez Form use prop value and event onChange to sync data with your input. You usually use value to get data from input, so Ez Form do the same, but it is automatic.

If you want to get data from your custom input component, just make sure that your input component has two things bellow:

  • Prop value: Form data will be pass to your input via this prop.
  • Event onChange: Ez Form will listen to this event to update data from your input.

You can change these props name by updating these options:

  • valuePropName: The name of value prop in your input.
  • changeEventName: The name of change event in your input.

These options may useful when working with checkbox or radio.

Blur event

By default, Ez Form will listen to event onBlur to determine is input blur. So your component can emit onBlur to be compatible with Ez Form.

You can change this event name by updating the following option:

  • blurEventName: The name of blur event in your input.

Ez Form