vuelider
v0.0.4
Published
This project is still under heavy development.
Downloads
2
Readme
vuelider
This project is still under heavy development.
Feel free to join us and make your first pull request.
If you 💖 like Vuelider, Give us a ⭐ star to support us.
Getting Started
import { ref } from 'vue'
import { createValidator } from 'vuelider'
import { required } from 'vuelider/dist/rules'
const registration = ref({
account: 'foo',
password: ''
})
const required = value => value !== '' }
const schema = {
account: {
$rules: {
required
}
},
password: {
$rules: {
required
}
}
}
const validator = createValidator(todos, schema)
validator.$validate()
console.log(validator.$isAnyInvalid)
// true
APIs
function createValidator(target, schema): Validator
Methods
validator.$touch: () => void
validator.$validate: () => void | Promise<void>
validator.$reset: () => void
Properties
validator.$isTouched: boolean
validator.$isAnyTouched: boolean
validator.$isInvalid: boolean
validator.$isAnyInvalid: boolean
validator.$isPending: boolean
validator.$isAnyPending: boolean
validator.$isValidated: boolean
validator.$isAnyValidated: boolean
validator.$rules
validator.$errors
validator.$ruleResults