HTML:
<div v-for="(item, index) in list" :key="index">
<input v-model="item.enable_amount" type="number" @input=" numberFixedDigit($event, item, 'enable_amount')"/>
</div>
data:
list: [ { enable_amount: null}, { enable_amount: null}, ],js:
numberFixedDigit(e, obj, name) { e.target.value = e.target.value.match(/^\d*(\.?\d{0,2})/g)[0] || ""; this.$nextTick(() => { obj[name] = Number(e.target.value) || null; }); },