IFormField

interface
Form & Input

Internal registration record for a field inside an OrigamForm — carries the field id, validation/reset methods, the component instance, and the current valid/error state.

TypeScript

Définition

La définition TypeScript de l'interface telle que trouvée dans le code source d'origam. Cliquez sur l'icône de copie pour copier l'extrait.

typescript

API

Propriétés

Chaque propriété déclarée par cette interface, avec son type, son caractère optionnel et sa valeur par défaut.

id
requis
number | string
Unique identifier of the field within the form.
validate
requis
() => Promise<Array<string>>
Run validation rules and return an array of error messages.
reset
requis
() => Promise<void>
Reset the field value and clear validation state.
resetValidation
requis
() => Promise<void>
Clear validation errors without resetting the value.
vm
requis
Raw<ComponentInternalInstance>
Raw reference to the field component instance.
isValid
boolean | null
Current validity state: true, false, or null when untouched.
errorMessages
requis
Array<string>
Current list of error messages for this field.

Écosystème

Utilisé par

Composants et composables qui étendent ou consomment cette interface.

Usage

Exemples

Extraits de code prêts à coller utilisant cette interface.

Accessing registered fields via IFormProvide

typescript