import store from '@/store'
export default {
  install(Vue, options) {
    if (options.developmentOff && process.env.NODE_ENV === 'development') return
    window.$vueApp.config.errorHandler = (error, vm, mes) => {
      let info = {
        type: 'script',
        code: 0,
        mes: error.message,
        url: window.location.href,
      }
      Vue.nextTick(() => {
        store.dispatch('addErrorLog', info)
      })
    }
  },
}
