simple-vue-validator

A simple yet flexible validator library for vue.js

  • 所有者: semisleep/simple-vue-validator
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Simple Vue Validator

Simple Vue validator is a lightweight yet flexible plugin for Vue.js 2.0 that allows you to validate input fields, and display errors. It watches changes of your model data, validates them and informs you with the validation result.

It supports the following features:

  • Fully customized validation rules.
  • Cross field validation.
  • Async/ajax validation (with supports of loading indicator, result caching, debounced user input).
  • Validating custom component.
  • Dynamic form / multiple validation instances.

Documentation

Please checkout the full documentation for more detail.

Installation

Package is installable via npm.

npm install --save simple-vue-validator

You can also install it via bower.

bower install --save simple-vue-validator

NOTE: for bower package, please use /dist/plugin.js.

Configuration

import Vue from 'vue';
import SimpleVueValidation from 'simple-vue-validator';
Vue.use(SimpleVueValidation);

Basic Usage

Define the validators object in your vue / component instance:

validators: {
      email: function (value) {
        return Validator.value(value).required().email();
      }
    }

In the template HTML use the validation object injected by the library to display validation status / results.

<div class="message">{{ validation.firstError('email') }}</div>

Please checkout the full documentation for more detail.

license MIT

主要指标

概览
名称与所有者semisleep/simple-vue-validator
主编程语言Vue
编程语言CSS (语言数: 4)
平台
许可证MIT License
所有者活动
创建于2016-12-09 13:55:55
推送于2023-01-11 22:28:35
最后一次提交2021-05-27 17:12:50
发布数0
用户参与
星数292
关注者数9
派生数28
提交数201
已启用问题?
问题数55
打开的问题数15
拉请求数6
打开的拉请求数20
关闭的拉请求数6
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?