<a-button type="primary" ghost @click="addItem" size="small">增加</a-button>
<a-row :gutter="[16, 16]" v-for="(list, otherIndex) inlists" :key="otherIndex">
<a-col :span="5">
<a-input v-model.trim="form.entrancePlanList[planIndex].planFeeList[otherIndex].defaultFee" placeholder="默认金额"/>
</a-col>
<a-col :span="2">
<a-button type="danger" ghost @click="delItem(planIndex, otherIndex)">删除</a-button>
</a-col>
</a-row>
js代码如下:
methods:{
// 添加
addItem() {
this.lists.push({})
},
// 删除v-for模块的内容
delItem(planIndex, otherIndex) {
this.lists.splice(otherIndex, 1)
}
}