vuerify

Validation plugin for Vue.js
922 188
Install
npm install vuerify
Latest Version:0.4.0
Vue:1
Older releases:2
License:WTFPL
Last Updated:Jun 21, 2020
Links: GitHub  ·  npm
Maintainer: qingwei.li

Vuerify

Build Status npm Coverage Status badge-size

Validation plugin for Vue.js

Features

  • Supports both Vue 1.x and 2.0
  • Compact
  • Simple

Demo

Docs

Installation

npm i vuerify -S

install directive

# Vue 1.x
npm i v-vuerify -S

# Vue 2.x
npm i v-vuerify-next -S

Usage

import Vue from 'vue'
import Vuerify from 'vuerify'

Vue.use(Vuerify /*, add rules */)

component

{
  template: `
    <form @submit.prevent="handleSubmit">
      <input type="text" v-model="username">
      <input type="password" v-model="password">
      <input type="password" v-model="conform">
      <input type="submit">
      <ul><li v-for="err in errors" v-text="err"></li></ul>
    </form>
  `,
  data () {
    return {
      username: '',
      password: '',
      conform: ''
    }
  },

  vuerify: {
    username: 'required',
    password: {
      test: /\w{4,}/,
      message: '至少四位字符'
    },
    conform: {
      test (val) {
        return val === this.password
      },
      message: '密码输入不一致'
    }
  },

  compouted: {
    errors () {
      return this.$vuerify.$errors
    }
  },

  methods: {
    handleSubmit () {
      if (this.$vuerify.check()) {
        // do sth
      }
    }
  }
}

Development

npm install
npm run dev

TODO

  • English Documentation

License

WTFPL

Related Packages

formvuelate

Schema Form Generator

47,749 443
jervis-form

A dynamic Vue 3 form library for building configurable forms.

2,032
vee-validate

Painless forms for Vue.js

45,982,707 11,260
@vee-validate/zod

vee-validate integration with zod schema validation

13,782,300 11,260

Version History

Version Released Vue License
0.4.0 ^1.0.26 WTFPL
0.3.5 ^1.0.26 WTFPL
0.3.4 ^1.0.26 WTFPL
0.3.3 ^1.0.26 WTFPL
0.3.2 ^1.0.26 WTFPL