refine main.js
This commit is contained in:
14
src/errorLog.js
Normal file
14
src/errorLog.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import Vue from 'vue'
|
||||
import errLog from '@/store/errLog'
|
||||
|
||||
// 生产环境错误日志
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
Vue.config.errorHandler = function(err, vm) {
|
||||
console.log(err, window.location.href);
|
||||
errLog.pushLog({
|
||||
err,
|
||||
url: window.location.href,
|
||||
vm
|
||||
})
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user