cwj_monitoring 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,19 +31,20 @@ npm i cwj_monitoring
|
|
|
31
31
|
引入
|
|
32
32
|
|
|
33
33
|
```js
|
|
34
|
-
import { init } from
|
|
34
|
+
import { init } from 'cwj_monitoring';
|
|
35
35
|
|
|
36
36
|
//使用 init 全局进行初始化
|
|
37
|
-
init({
|
|
38
|
-
url:
|
|
37
|
+
init({
|
|
38
|
+
url: 'http://localhost:8080', //必传参数,数据上传服务器地址
|
|
39
39
|
max: 10, //可选参数,最大缓存数,即超过缓存数立即上传,默认为5
|
|
40
40
|
time: 60000, //可选参数,最大缓存时间,即超过最大缓存时间立即上传,默认30s
|
|
41
|
-
error:
|
|
42
|
-
click:
|
|
43
|
-
performance:
|
|
44
|
-
router:
|
|
41
|
+
error: true, //可选参数,是否监听错误事件,默认关闭
|
|
42
|
+
click: true, //可选参数,是否监听点击事件,默认关闭
|
|
43
|
+
performance: true, //可选参数,是否监听性能指标,默认关闭
|
|
44
|
+
router: true, //可选参数,是否监听路由事件,默认关闭
|
|
45
|
+
data: {}, //可选参数,例如项目的名称与版本号data:{vs:'0.1.1'}
|
|
45
46
|
});
|
|
46
47
|
|
|
47
48
|
//无论vue的全局错误捕获,还是react的错误边界,都可使用window.$track.emit手动上传错误
|
|
48
|
-
window.$track.emit(type,data)
|
|
49
|
+
window.$track.emit(type, data);
|
|
49
50
|
```
|