watch:{
invoice:function(){
// 只有数字
this.invoice= this.invoice.replace(/[^\d]/g,'')
// 去掉空格
// this.invoice=this.invoice.replace(/\s/g,'').replace(/[^\d]/g,'').replace(/(\d{4})(?=\d)/g,'$1 ');
},
// 只能是数字字母
idnumber:function(val){
this.idnumber=this.idnumber.replace(/[\W]/g,'').toUpperCase();
},
},
vue watch监听input内容是否是数字
最新推荐文章于 2024-07-24 11:30:28 发布