0.0.4 • Published 4 years ago

vuelider v0.0.4

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

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

Builtin Rules

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago