main.js中的代码
store.commit('recruitmentArr', recruitmentArr);
mutations.js中的代码
import * as types from './mutation-types'
export default {
[types.recruitmentArr] (state, val) {
state.account = val
}
}
mutation-types.js 中的代码
export const recruitmentArr = 'recruitmentArr'
通过console.log() 打印出mutations 为空对象
在mutations.js中console.log(types)后 刷新页面 竟然正常了