refine main.js

This commit is contained in:
Pan
2017-08-21 15:55:46 +08:00
parent e912cea26a
commit 9768305166
9 changed files with 146 additions and 142 deletions

14
src/errorLog.js Normal file
View 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
})
};
}