vv-jsdt
v0.0.2
Published
validate based on vue2
Downloads
3
Readme
#vv-validator Validator component for Vue.js
#Installation
npm install vv-jsdt
#Usage
import Vue from 'vue'
import VV from 'vv-jsdt'
Vue.use(VV);
#Features rules are supported
- custome
- function
- Asynchronous
#demo
new Vue({
el: '#VV',
data () {
return {
username: '',
fn:'',
remote:'',
}
},
vvlist: {
username: 'required',
fn:{
test:function(val){
return val==1?true:false;
},
message:"只能是1"
},
remote:{
remote:function (val,cb) {
setTimeout(function () {
if(val==2){
cb(true);
}else{
cb(false);
}
}, 1500);
},
message:"只能是2"
}
}
})