recently encountered a very frustrating situation on the development platform.
to put it simply, logical code can be changed in some places and suddenly not in some places
state
data similar to credit card users are stored as Array < Object >
mutations: {
updateUserCard(state, newCard) {
state.userCardsArray.forEach((userCard, key) => {
if(userCard.id == newCard.id){
//
state.userCardsArray.splice(key, 1);
//
state.userCardsArray.splice(key, 0, newCard)
}
});
}
}
although it can solve the problem, I feel helpless about this mistake.
I would like to ask someone to give me some advice
Thank you for reading