基于vue.js 和 element-ui 的 validate验证实现
class="input-cardnum"
name="card"
v-model="rulesFrom.credentialsCode"
autocomplete="off"
>
class="input-cardnum"
name="card"
v-model="rulesFrom.mobile"
autocomplete="off"
>
data(){
const idCardValidity = (rule, code, callback) => {
var city = { 11: "北京", 12: "天津", 13: "河北", 14: "山西", 15: "内蒙古", 21: "辽宁", 22: "吉林", 23: "黑龙江 ", 31: "上海", 32: "江苏", 33: "浙江", 34: "安徽", 35: "福建", 36: "江西", 37: "山东", 41: "河南", 42: "湖北 ", 43: "湖南", 44: "广东", 45: "广西