refactor[errorLog]: save the logs in vuex

This commit is contained in:
Pan
2017-12-13 13:52:14 +08:00
parent f9aaaa9091
commit a68413cb8f
6 changed files with 34 additions and 31 deletions

View File

@@ -0,0 +1,17 @@
const errorLog = {
state: {
logs: []
},
mutations: {
ADD_ERROR_LOG: (state, log) => {
state.logs.push(log)
}
},
actions: {
addErrorLog({ commit }, log) {
commit('ADD_ERROR_LOG', log)
}
}
}
export default errorLog