I'm trying to modify a state then push it back to store but it returns me an error
methods : {
modalBtnClick(index){
let btns = [];
this.$store.state.utility.modal_content.btns.forEach((item)=>{
btns.push(item);
});
btns[index].result = true;
this.$store.commit('utility/modal_content',{
body : this.$store.state.utility.modal_content.body,
btns : btns
});
}
}
Error: [vuex] do not mutate vuex store state outside mutation handlers.
Any help, ideas is greatly appreaciated.