标签:val target number get put ace key 整数 v-model
<input type="number" @keydown="handleInput2" placeholder="请输入或查看" v-model="item.SalePrice">
handleInput2(e) {
// 通过正则过滤小数点后两位
e.target.value = (e.target.value.match(/^\d*(\.?\d{0,1})/g)[0]) || null
},
<input type="number" @keydown="handleInput" placeholder="请输入" v-model="SaleQty">
handleInput(e) {
// log(e.target.value)
e.target.value=e.target.value.replace(/[^\d]/g,'');
},
标签:val target number get put ace key 整数 v-model
原文地址:https://www.cnblogs.com/wbyixx/p/12209233.html