- <el-input @keydown.native="handleInput2"
- oninput ="value=value.replace(/[^0-9.]/g,'')"
- v-model="form.afterSale_rate" placeholder="请输入 " />
- handleInput2(e) {
- // 通过正则过滤小数点后两位
- e.target.value = (e.target.value.match(/^\d*(\.?\d{0,1})/g)[0]) || null
- },
- <el-input
- v-model="scope.row[title.prop]"
- oninput="value=value.replace(/^([0-9-]\d*\.?\d{0,2})?.*$/,'$1')"
- ></el-input>