vuelider
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

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.$isTouchedboolean
validator.$isAnyTouchedboolean
validator.$isInvalidboolean
validator.$isAnyInvalidboolean
validator.$isPendingboolean
validator.$isAnyPendingboolean
validator.$isValidatedboolean
validator.$isAnyValidatedboolean
validator.$rules
validator.$errors
validator.$ruleResults

Builtin Rules

Readme

Keywords

Package Sidebar

Install

npm i vuelider

Weekly Downloads

0

Version

0.0.4

License

MIT

Unpacked Size

48.7 kB

Total Files

29

Last publish

Collaborators

  • iendeavor