So for example, my json response looks like:
"name": "John"
"value": "5"
Then I pass it to my state
commit("SET_USER", response.data.user);
But, if name is == "John" i want the value to be 10 and pass it to mutation. Is it possible to do this?
I can access value like this response.data.user[0].value
if(response.data.user[0].name == "John") {
response.data.user[0].value == "10"
}
commit("SET_USER", response.data.users); // <-- state.cards
})
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…