removePair(index) {
let i = this.data.findIndex((row)=>{
return row.key == index
})
console.log(i)
this.data.splice(i,1)
}
<a-table :columns="columns" :data-source="data">
<span slot="action" slot-scope="scope">
<button @click="removePair(scope.key)">删除</button>
</span>
</a-table>
添加操作:
addPair() {
const pair = {
key: this.index,
price: this.pair.price,
desc: this.pair.weight
}
this.data.push(pair)
this.index++;
// console.log(this.columns)
},