Answers for "vuex add multiple payload to mutation"

0

vuex add multiple payload to mutation

// call
store.commit('authenticate', {
    token,
    expiration,
});

// mutation
mutations: {
    authenticate(state, { token, expiration }) {
        localStorage.setItem('token', token);
        localStorage.setItem('expiration', expiration);
    }
}
Posted by: Guest on June-18-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language