0👍
✅
simple solution i found that use findIndex
methods
var vm = this;
this.$echo.channel("accept-coin").listen("AcceptCoin", response => {
var indexid = vm.coins.findIndex(f => f.id === response.coin.id); //<-- this find index with coin id so then i can do whatever
vm.$set(vm.coins, indexid, response.coin);
vm.coins[indexid].result = response.result;
vm.$auth.fetchUser();
setTimeout(() => {
this.coins.splice(indexid, 1);
}, 10000);
});
Hope this helps
Source:stackexchange.com