js中window.onerror方法会打印出报错信息 可以用来记录错误信息 ··· // js中window.onerror方法会打印出报错信息 window.onerror=function() { console.log('arguments', arguments); } function test(){ error } test() Vue中则在main.js中进行全局捕获 Vue.config.errorHandler=function(){ console.log('arguments', arguments); }