@ued2345/octopus-util
Advanced tools
Comparing version 1.1.6-0 to 1.1.6-3
{ | ||
"name": "@ued2345/octopus-util", | ||
"version": "1.1.6-0", | ||
"version": "1.1.6-3", | ||
"description": "ued2345 utils", | ||
@@ -5,0 +5,0 @@ "main": "dist/octopus-util.min.js", |
@@ -98,2 +98,37 @@ ### 技术选型 | ||
#### 错误收集 | ||
> * window.onerror | ||
> * 资源加载失败捕获 | ||
> * Vue组件错误捕获 | ||
> * Promise中没有catch捕获错误会被捕获 | ||
* vue项目中接入 | ||
```javascript | ||
import Vue from 'vue' | ||
import { CatchError} from "@ued2345/octopus-util"; | ||
CatchError.getInstance(Vue, { | ||
reportFun: function(data) { // 错误上报 | ||
console.log('error:', data) | ||
}, | ||
}) | ||
``` | ||
* 相关配置说明 | ||
```javascript | ||
// 调用方法 | ||
CatchError.getInstance(Vue, opts) | ||
/** | ||
* Vue: null 不会捕获vue 错误信息 | ||
* opts: { | ||
* isReportNow: boolean; //是否立即上报(是:delay时间后立即执行多次上报,否:每隔delay时间上报一次) | ||
* delay: number; // 延迟多长时间上报(默认3000) | ||
* random: number; // 抽样上报 (0-1)1全量(默认全量) | ||
* repeatNum: number; // 重复上报次数(默认3次), | ||
* reportUnhandledRejection: boolean; // 是否捕获promise.reject错误 | ||
* reportFun: CallBack; // 上报错误函数 | ||
* } | ||
**/ | ||
``` | ||
### vue相关工具 | ||
@@ -157,2 +192,2 @@ ##### 埋点工具 | ||
<div v-else v-bang:mounted="`显示2`" key="显示2">显示2</div> | ||
``` | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37571
192