Answer the question
In order to leave comments, you need to log in
Is it possible to write mutation in vuex via Object.assign?
Good morning
In vuex there is a User module which will be like this:
state: {
_id: "",
firstName: "",
lastName: "",
middleName: ""
}
mutations: {
SET_USER(state, payload = {}) {
state = Object.assign(state, payload)
}
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question