BlogPlaygroundOne

VValidation API


Props
name
type
default
boolean
null

Removes the ability to click or target the component.

boolean
false

Puts the input in a manual error state.

string | string[]
[]

Puts the input in an error state and passes through custom error messages. Will be combined with any validations that occur from the rules prop. This field will not trigger validation.

boolean
false

Forces a focused state styling on the component.

string
undefined

Sets the text of the v-label or v-field-label component.

string | number
1

Control the maximum number of shown errors from validation.

unknown
undefined

The v-model value of the component. If component supports the multiple prop, this defaults to an empty array.

string
undefined

Sets the component’s name attribute.

boolean
null

Puts input in readonly state.

(
  | string
  | boolean
  | PromiseLike<ValidationResult>
  | ((value: any) => string | false | true)
  | ((value: any) => PromiseLike<ValidationResult>)
  | [string, any, string]
)[]
[]

Accepts a mixed array of types function, boolean and string. Functions pass an input value as an argument and must return either true / false or a string containing an error message. The input field will enter an error state if a function returns (or any value in the array contains) false or is a string.

  | 'eager'
  | 'lazy'
  | 'blur'
  | 'input'
  | 'submit'
  | 'invalid-input'
  | 'blur lazy'
  | 'input lazy'
  | 'submit lazy'
  | 'invalid-input lazy'
  | 'blur eager'
  | 'input eager'
  | 'submit eager'
  | 'invalid-input eager'
  | 'lazy blur'
  | 'lazy input'
  | 'lazy submit'
  | 'lazy invalid-input'
  | 'eager blur'
  | 'eager input'
  | 'eager submit'
  | 'eager invalid-input'
undefined

Change what type of event triggers validation to run.

any
undefined

The value used when applying validation rules.

Events
name
type
[boolean]

Event that is emitted when the component’s focus state changes.

[unknown]

Event that is emitted when the component’s model changes.

Slots
{ errorMessages: ComputedRef<string[]> isDirty: ComputedRef<boolean> isDisabled: ComputedRef<boolean> isReadonly: ComputedRef<boolean> isPristine: ShallowRef<boolean, boolean> isValid: ComputedRef<boolean | null> isValidating: ShallowRef<boolean, boolean> reset: () => Promise<void> resetValidation: () => Promise<void> validate: (silent: boolean) => Promise<string[]> validationClasses: ComputedRef<{ [x: string]: boolean }> }

The default Vue slot.