wj-tracker
v1.0.2
Published
```shell # npm npm i wj-tracker # pnpm pnpm add wj-tracker # yarn yarn add wj-tracker ```
Downloads
1
Readme
安装
# npm
npm i wj-tracker
# pnpm
pnpm add wj-tracker
# yarn
yarn add wj-tracker
构造参数
options
| 参数 | 说明 | 类型 | 必传 | 备注 | | :------------: | :-----------------: | :-----------------: | :--: | :--: | | uuid | 前端用户唯一标识 | string | | | | requestUrl | 上报的api接口 | string | √ | | | historyTracker | 开启history路由追踪 | boolean | | | | hashTracker | 开启hash路由追踪 | boolean | | | | domTracker | 开启dom事件追踪 | boolean | | | | jsError | 开启js报错追踪 | boolean | | | | sdkVersion | sdk版本 | string|number | | | | extra | 透传字段 | Record<string, any> | | |
mouseEventList
监听事件,默认监听"click", "dblclick", "contextmenu",
使用
import Tracker from 'wj-tracker/dist/index';
const tracker = new Tracker({
requestUrl: 'your api',
jsError: false,
domTracker: true,
})