0๐
โ
I need to add a function to pull the id from the row. then use that id to push the row into another array.
added:
addItem(item) {
this.newAgentId(item.id);
console.log(item);
confirm("Are you sure you want to add this item?") &&
this.agents.push(item);
},
newAgentId(keyID) {
if (this.selectedRows.includes(keyID)) {
this.selectedRows = this.selectedRows.filter(
selectedKeyID => selectedKeyID !== keyID
);
} else {
this.selectedRows.push(keyID);
}
}
Source:stackexchange.com