📜  vuex 向突变添加多个有效负载 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:13.232000             🧑  作者: Mango

代码示例1
// call
store.commit('authenticate', {
    token,
    expiration,
});

// mutation
mutations: {
    authenticate(state, { token, expiration }) {
        localStorage.setItem('token', token);
        localStorage.setItem('expiration', expiration);
    }
}