效果图:
<input class="price-input" type="digit" auto-focus="true"
v-model="refundPrice" @input="inputChange" />
inputChange() {
setTimeout(()=>{
this.refundPrice = this.refundPrice.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');
},0);
},
效果图:
<input class="price-input" type="digit" auto-focus="true"
v-model="refundPrice" @input="inputChange" />
inputChange() {
setTimeout(()=>{
this.refundPrice = this.refundPrice.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');
},0);
},