限制只能输入两位小数:
HTML代码:
<el-input
v-model="UpperClass"
@input="moneyInput"
style="width: 70px"
></el-input
js代码:
moneyInput(){
let tem = this.obscene.toString().match(/^\d*(\.?\d{0,2})/g)[0];
this.obscene = tem;
// 如果你没有预先定义 Commission ,你需要使用 $set 方法
// this.$set(this.jobData, 'Commission ', tem);
},