A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pikax.me/vue-composable/composable/validation/validation below:

Website Navigation


Validation | vue-composable

# Validation

validation composable inspired by vuelidate (opens new window)

WARNING

Currently there's no exported validators.

# Parameters Parameters Type Required Default Description options Object true Validation input object # State

The useValidation function exposes the following reactive state:

State Type Description form Reactive<Options & Validation<Object>> Reactive form validation object

WARNING

The returned value is an reactive() object, do not deconstruct it.

# Input

The input object can be an ValidationObject or a nested dictionary of ValidationObject.

# ValidationObject

ValidationObject is composed by $value(ref<any>|any) and validators((o: ref<any>|any, ctx: object)=>Promise<boolean>|boolean).

TIP

You can store any value you want, by using $ as the first letter of the property name.

# Return

It will return an reactive object.

On the example above, the result will be:

# NestedValidationObject

The validation composable allows you to have as many nested objects as you want, the only requirement is it ends on a ValidationObject;

# Example

Form validation

# Code

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4