el-form-validator
v2.3.0
Published
form data form validator
Downloads
55
Readme
form-validator
use (element-ui)
import validator from 'el-form-validator';
export default {
data () {
return {
rules: {
column: {
rules: 'required|min:11|max:11',
validator: validator.verification,
trigger: 'blur'
}
}
}
}
}
or
import validator from 'el-form-validator';
validator.valid(rules, value)
validator.valid('required|max:10|min:6', '123456'); // return true
validator.valid('required|max:10|min:6', '12'); // return error message
make
let data = {
name: '',
...
}
let rules = {
name: 'required|max:10|min:6',
...
}
// return Validator
validator.make(data, rules);