error-capture-handle
v1.1.9
Published
``` 在main.js 中引入
Downloads
45
Readme
使用方法
在main.js 中引入
npm install error-capture-handle -s
import errorHanleCature from 'error-capture-handle'
参数 config 必传
const config = {
url: '', // 默认为 http://notice.91cyt.com/messagePush(非必填)
userName: '测试', // 当前操作的用户(用户信息接口)(必填)
system_code: '', // 申请机器人 system_code(必填)
secret_key: '', // 申请机器人 secret_key(必填)
robot_name: '' // 申请机器人 robot_name(必填)
isNeedCaptureResourceError: false, // 是否开启捕获资源加载出错,默认为false(非必填)
openDebugger: process.env.NODE_ENV === 'development', // 是否开启debugger打印错误位置,默认为false(非必填)
}
// 调用一
errorHanleCature(config).ListenerError() // 只监听全局 error
// 调用二
errorHanleCature(config).ListenerVueError(Vue) // 监听vue中错误
// 调用三
errorHanleCature(config).ListenerError().ListenerVueError(Vue) // 监听全局 error 、监听vue中错误