Skip to content

FormItem ​

Standalone form item component for building custom form layouts. This component is extracted from EzDynamicForm as a basic form item functionality.

Basic Usage ​

Component Types ​

Form Validation ​

Custom Slots ​

Attributes ​

AttributeDescriptionTypeRequiredDefault
v-modelForm dataanyNo-
configForm item configFormItemConfigYes-
formDataOverall form dataRecord<string, any>No{}

FormItemConfig

AttributeDescriptionTypeRequiredDefault
propField namestringYes-
labelLabelstringNo-
typeComponent typeFormItemType | stringNo-
defaultValueDefault valueanyNo-
rulesValidation rulesFormItemRuleNo-
requiredWhether requiredbooleanNofalse
requiredMessageRequired messagestringNo-
spanGrid column spannumberNo-
hiddenWhether to hidebooleanNofalse
disabledWhether disabledbooleanNofalse
placeholderPlaceholder (auto-generated by type when omitted; for range types use startPlaceholder / endPlaceholder)stringNo-
startPlaceholderRange-type start placeholderstringNo-
endPlaceholderRange-type end placeholderstringNo-
optionsOptions configurationFormItemOption[]No-
attrsComponent attributesRecordNo-
componentCustom componentComponentNo-
itemAttrsExtra el-form-item attributesRecordNo-
showConditional displayFunctionNo-
disabledWhenConditional disableFunctionNo-
serializeSerialize a field before submit; returning an object with value/fields/omit keys is treated as a transform output, otherwise written back as a plain value. Useful for splitting date ranges, cleaning values or deriving extra fieldsFunctionNo-
deserializeDeserialize when backfilling external data into the formFunctionNo-

TIP

For FormItemType enum definition, please refer to DynamicForm Component Documentation

Slots ​

Slot NameDescriptionParameters
—Custom form content{ config: FormItemConfig, value: any, formData: Record }
labelCustom label content{ config: FormItemConfig }

Events ​

Event NameDescriptionType
update:modelValueTriggered when value changesFunction

Released under the MIT License