validation
composable inspired by vuelidate (opens new window)
WARNING
Currently there's no exported validators
.
Object
true
Validation input object # State
The useValidation
function exposes the following reactive state:
Reactive<Options & Validation<Object>>
Reactive form validation object
WARNING
The returned value is an reactive()
object, do not deconstruct it.
The input object can be an ValidationObject or a nested dictionary of ValidationObject.
# ValidationObjectValidationObject 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.
It will return an reactive object.
On the example above, the result will be:
# NestedValidationObjectThe 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 # CodeRetroSearch 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