vuex add multiple payload to mutation

Solutions on MaxInterview for vuex add multiple payload to mutation by the best coders in the world

showing results for - "vuex add multiple payload to mutation"
Mattia
04 Jun 2016
1// call
2store.commit('authenticate', {
3    token,
4    expiration,
5});
6
7// mutation
8mutations: {
9    authenticate(state, { token, expiration }) {
10        localStorage.setItem('token', token);
11        localStorage.setItem('expiration', expiration);
12    }
13}