refactor[errorLog]: save the logs in vuex
This commit is contained in:
17
src/store/modules/errorLog.js
Normal file
17
src/store/modules/errorLog.js
Normal 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
|
Reference in New Issue
Block a user