errorLog.js 547 字节
Newer Older
init  
小木偶MO 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
/**
 * @description 异常捕获的状态拦截,请勿修改
 */
const state = () => ({
  errorLogs: [],
})
const getters = {
  errorLogs: (state) => state.errorLogs,
}
const mutations = {
  addErrorLog(state, errorLog) {
    state.errorLogs.push(errorLog)
  },
  clearErrorLog: (state) => {
    state.errorLogs.splice(0)
  },
}
const actions = {
  addErrorLog({ commit }, errorLog) {
    commit('addErrorLog', errorLog)
  },
  clearErrorLog({ commit }) {
    commit('clearErrorLog')
  },
}
export default { state, getters, mutations, actions }