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
placeholderPlaceholderstringNo-
optionsOptions configurationFormItemOption[]No-
attrsComponent attributesRecordNo-
slotNameSlot name for custom renderstringNo-
componentCustom componentComponentNo-
itemAttrsExtra el-form-item attributesRecordNo-
showConditional displayFunctionNo-
disabledWhenConditional disableFunctionNo-

TIP

For FormItemType enum definition, please refer to DynamicForm Component Documentation

Slots

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

Events

Event NameDescriptionType
update:modelValueTriggered when value changesFunction

Released under the MIT License