delete object from array in vue code example
Example 1: vuejs remove object from array
array.splice(index, deleteCount)
array1 = ['one', 'two', 'three'];
array1.splice(1, 1);
console.log(array1);
array2 = [{id:1}, {id:2}, {id:3}];
array2.splice(2, 1);
console.log(array2);
Example 2: delete item from array vuejs
let currentTeamUsers = this.team.user_ids;
let userToRemove = this.selectedUsersMulTeams.map(selectedUsersMulTeams => selectedUsersMulTeams.user_id);
let userIndex = currentTeamUsers.indexOf(userToRemove)
currentTeamUsers.splice(userIndex, 1);