vreg
A Vue.js project
使用方式
// main.js // 自定义指令// template<div v-reg:basic="{rule: 'c', msg: 'error3', tag: 'c', test: c}"></div><input v-model="a" v-reg:basic="{rule: 'a', msg: 'error1', tag: 'a', test: a}"><button v-reg:basiccheck="{check: switch}" @click="ck">click me</button>// basic 分组// rule 规则// msg 提示信息// tag 分组下的子项// test 需校验的字段// check 表示这个是触发校验的开关// switch true / false 需要异步执行 不然不生效
【js使用方式】
methods: { thisswitch = true if console; }