0๐
โ
If I were you, I would try the following:
remove(line) {
axios.delete(domain + 'line/' + line._id)
.then(res => {
let index = this.lineList.indexOf(line)
this.lineList.splice(index, 1);
})
.catch(err => {
console.log(error);
});
}
With this, you are sure that you have the correct index for the item at the moment that you want to delete it thanks to let index = this.lineList.indexOf(line)
Source:stackexchange.com