例如如下代码:
<input type="text" v-model="sellPrice">
<input type="text" v-model="buyVolume">
reg:/^[0-9]+(.[0-9]{1,8})?$/
reg1:/[0-9]d*/
watch:{
buyPrice:function(){
}, sellPrice:function(){ let a = this.sellPrice; this.sellPrice = a.match(this.reg,'');
}, buyVolume:function(){ this.buyVolume = this.buyVolume.match(/[0-9]\d*/,'');
}, sellVolume:function(){ this.sellVolume = this.sellVolume.match(/[0-9]\d*/,'');
}
}Price无法成功。
为什么sellVolume能成功但是会报this.sellVolume.match is not a function
森栏
慕的地10843
随时随地看视频慕课网APP
相关分类