feat[ErrorLog]: add a clear button in ErrorLog component (#2065)

This commit is contained in:
toruksmakto
2019-05-12 12:00:00 +08:00
committed by 花裤衩
parent 7b0d527bf9
commit 3a4543478f
2 changed files with 17 additions and 1 deletions

View File

@@ -5,12 +5,18 @@ const state = {
const mutations = {
ADD_ERROR_LOG: (state, log) => {
state.logs.push(log)
},
CLEAR_ERROR_LOG: (state) => {
state.logs.splice(0)
}
}
const actions = {
addErrorLog({ commit }, log) {
commit('ADD_ERROR_LOG', log)
},
clearErrorLog({ commit }) {
commit('CLEAR_ERROR_LOG')
}
}