1 |
- {"remainingRequest":"/Users/lihai/jolijoli/pad_spa/node_modules/babel-loader/lib/index.js!/Users/lihai/jolijoli/pad_spa/node_modules/eslint-loader/index.js??ref--13-0!/Users/lihai/jolijoli/pad_spa/src/common/errorHandler.js","dependencies":[{"path":"/Users/lihai/jolijoli/pad_spa/src/common/errorHandler.js","mtime":1649813268621},{"path":"/Users/lihai/jolijoli/pad_spa/babel.config.js","mtime":1649813268617},{"path":"/Users/lihai/jolijoli/pad_spa/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/lihai/jolijoli/pad_spa/node_modules/babel-loader/lib/index.js","mtime":315532800000},{"path":"/Users/lihai/jolijoli/pad_spa/node_modules/eslint-loader/index.js","mtime":499162500000}],"contextDependencies":[],"result":["import Vue from 'vue';\nimport { logFlag } from '@/config/env';\nexport default (function () {\n var errorHandler = function errorHandler(err, vm, info) {\n // `info` 是 Vue 特定的错误信息,比如错误所在的生命周期钩子\n var compName = \"\";\n\n if (vm) {\n compName = _formatComponentName(vm);\n compName = compName.replace(/\\\\/g, \"/\");\n }\n\n var obj = {\n component: compName,\n hook: info,\n err_msg: err + ''\n };\n var hosts = location.host;\n\n if (hosts.indexOf(\"localhost\") > -1 || hosts.indexOf(\"test\") > -1) {\n console.table(obj);\n }\n\n tool.$throwJS(obj);\n };\n\n Vue.config.errorHandler = errorHandler;\n}); //获取当前组件的路径\n\nfunction _formatComponentName(vm) {\n if (vm.$root === vm) return 'root';\n var name = vm._isVue ? vm.$options && vm.$options.name || vm.$options && vm.$options._componentTag : vm.name;\n return (name ? 'component <' + name + '>' : 'anonymous component') + (vm._isVue && vm.$options && vm.$options.__file ? ' at ' + (vm.$options && vm.$options.__file) : '');\n}",{"version":3,"sources":["/Users/lihai/jolijoli/pad_spa/src/common/errorHandler.js"],"names":["Vue","logFlag","errorHandler","err","vm","info","compName","_formatComponentName","replace","obj","component","hook","err_msg","hosts","location","host","indexOf","console","table","tool","$throwJS","config","$root","name","_isVue","$options","_componentTag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CAACA,IAAI,GAAG,gBAAgBA,IAAhB,GAAuB,GAA1B,GAAgC,qBAArC,KACCnB,EAAE,CAACoB,MAAH,IAAapB,EAAE,CAACqB,QAAhB,IAA4BrB,EAAE,CAACqB,QAAH,CAAYE,MAAxC,GACK,UAAUvB,EAAE,CAACqB,QAAH,IAAerB,EAAE,CAACqB,QAAH,CAAYE,MAArC,CADL,GAEK,EAHN,CADJ;AAMH","sourcesContent":["import Vue from 'vue'\nimport {logFlag} from '@/config/env'\nexport default () =>{\n const errorHandler = (err, vm, info) => {\n // `info` 是 Vue 特定的错误信息,比如错误所在的生命周期钩子\n let compName = \"\";\n if (vm) {\n compName = _formatComponentName(vm);\n compName = compName.replace(/\\\\/g, \"/\");\n }\n let obj = {\n component: compName, \n hook: info, \n err_msg: err + ''\n }\n let hosts = location.host;\n if((hosts.indexOf(\"localhost\") > -1 || hosts.indexOf(\"test\") > -1)){\n console.table(obj);\n }\n tool.$throwJS(obj);\n }\n Vue.config.errorHandler = errorHandler;\n}\n\n//获取当前组件的路径\nfunction _formatComponentName(vm) {\n if (vm.$root === vm) return 'root';\n let name = vm._isVue\n ? (vm.$options && vm.$options.name) ||\n (vm.$options && vm.$options._componentTag)\n : vm.name;\n return (\n (name ? 'component <' + name + '>' : 'anonymous component') +\n (vm._isVue && vm.$options && vm.$options.__file\n ? ' at ' + (vm.$options && vm.$options.__file)\n : '')\n );\n}\n"]}]}
|