vntD InputNumber 数字输入框
<InputNumber style="width: 100px" :min="0.01" :max="detail.payAmount" v-model="refundPrice":parser="limitDecimalsP" ></InputNumber>
limitDecimalsF(value) { let reg = /^(-)*(\d+)\.(\d\d).*$/; return `${value}` .replace(/\B(?=(\d{3})+(?!\d))/g, ",") .replace(reg, "$1$2.$3"); }, limitDecimalsP(value) { let reg = /^(-)*(\d+)\.(\d\d).*$/; return value.replace(/¥\s?|(,*)/g, "").replace(reg, "$1$2.$3"); }
金额输入框搞的很烦人记录一下 截取小数点后两位