For vue2 projects, use @94ai/common-ui
LLMs.md

nf-form-item ​

A companion form item preserving native validation, label/error slots and collapse registration.

Import the components below; see the package README for standalone installation.

Examples ​

Basic usage ​

Loading example…
Basic usage

More examples 2 ​

Loading example…
More examples 2

Props ​

Text props follow the library language when omitted; defaults below use this language.

ParameterDescriptionTypeOptionsDefault
hiddenExclude the item from collapsing when true; the item remains visible.boolean—false
propField in the form model; required for validation and reset, supports path arrays.string | string[]—undefined
labelLabel text.string—undefined
labelWidthLabel width, e.g. 50px; supports auto and inherits the form setting when omitted.string | number—undefined
labelPositionLabel position; inherits the form setting when omitted.stringleft / right / top''
requiredWhether required; determined by validation rules when omitted.boolean—undefined
rulesValidation rules using the Element Plus / async-validator format.FormItemRule | FormItemRule[]—undefined
errorField error message; setting it immediately enters the error state and displays it.string—undefined
showMessageWhether to show validation error messages.boolean—true
inlineMessageDisplay validation messages inline.boolean—undefined
sizeControl size; mini maps to small and medium to default.stringmini / small / medium / default / largeundefined
validateStatusField validation state.stringerror / validating / successundefined
forNative label for attribute, referencing an input ID.string—undefined

Events ​

No component events. Listen to validate on the parent NfForm for validation results.

Slots ​

ParameterDescriptionPayload
defaultForm Item content: field controls or action buttons.—
labelCustom label content.{ label: string }
errorCustom rendering of validation messages.{ error: string }

Methods ​

NameTypeDescription
validate(trigger, callback?) / resetField() / clearValidate()nativeElement Plus field methods.

Migration notes ​

Use with NfForm. hidden excludes the item from collapse; it does not hide it. Use Vue 3 v-model and Element Plus rules rather than private Element UI instance properties.