loadNumber: function (event) {
var el = event.currentTarget;
var elValue = el.value;
var reg = /^((?!0)\d{1,2}|100)$/;
if (!elValue.match(reg)) {
elValue = "";
console.log("b")
return false;
} else {
return true;
}
}
我做的是用正则判断后重新赋值,问题出在不能重新赋值
<input v-model="UploadInfoModel.ER" @keyup="loadNumber($event)" />
梦里花落0921
慕雪0369431