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

Definition

The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.

typescript

API

Properties

Every property declared by this interface, with its type, optionality and default.

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

Ecosystem

Used by

Components and composables that extend or consume this interface.

Usage

Examples

Ready-to-paste code snippets using this interface.

Accessing registered fields via IFormProvide

typescript