html代码:
<input type="text" @input="input1($event , index)" v-model="item.number"
placeholder="请输入卡号" placeholder-class="input11">
js代码:
input1(e, index) {
console.log(e, index);
var card = e.detail.value;
//输入时每四位一个空格
var card = card.replace(/\s/g, '').
replace(/[^\d]/g, '').replace(/(\d{4})(?=\d)/g, '$1 ');
this.exigencyList[index].number = card
console.log("有间隔", this.exigencyList[index].number);
},