fe-drone-ci/src/errorLog.js

18 lines
383 B
JavaScript
Raw Normal View History

2017-08-21 07:55:46 +00:00
import Vue from 'vue'
import store from './store'
2017-08-21 07:55:46 +00:00
2017-12-12 10:14:31 +00:00
// you can set only in production env show the error-log
// if (process.env.NODE_ENV === 'production') {
Vue.config.errorHandler = function(err, vm, info, a) {
Vue.nextTick(() => {
store.dispatch('addErrorLog', {
err,
vm,
info,
url: window.location.href
})
console.error(err, info)
2017-12-12 10:14:31 +00:00
})
2017-08-21 07:55:46 +00:00
}
2017-12-12 10:14:31 +00:00
// }