1.手動(dòng)input寫方法校驗(yàn)
<input type="number" step="1" min="0"
onkeyup="this.value= this.value.match(/\d+(\.\d{0,2})?/) ? this.value.match(/\d+(\.\d{0,2})?/)[0] : ''"
>
2.使用element 的計(jì)數(shù)器
<el-input-number v-model="num" controls-position="right" @change="handleChange" :min="0" :max="10"></el-input-number>