Answer the question
In order to leave comments, you need to log in
Parameter not working in vuex?
Why does the passed argument work so strangely?
the code itself
const actions = {
async fetchUserSignIn (password, phoneNumber) {
const user = await authApi.fetchUserSignIn(password, phoneNumber)
return user
}
}
Answer the question
In order to leave comments, you need to log in
const actions = {
async fetchUserSignIn ({ commit }, { password, phoneNumber }) {
const user = await authApi.fetchUserSignIn(password, phoneNumber)
commit('commit_user_mutation' , user);
}
}
because the first argument to the action is the entire state/context of your store.
And you need to commit mutations to it, and not just what you have heaped up here, it doesn’t work that way at all.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question