Skip to content

Commit

Permalink
📝improve e.g. desc
Browse files Browse the repository at this point in the history
  • Loading branch information
宋慧武 committed Apr 13, 2019
1 parent c06e7e6 commit d4d21a6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,29 @@ Vue.use(VTrack, {
```js
/* track-events.js */
export default {
/** @desc UV、PV埋点 */
/**
* @name UVPV 固定名称不支持修改
* @desc UV、PV埋点
*/
UVPV() {
...
},
/**
* @name TONP 固定名称不支持修改
* @desc 页面停留时间埋点(Time on Page)
* @param {String} stt 进入页面时长,单位为秒
*/
TONP({ stt }) {
...
},
/**
* @name 18015 埋点唯一标识ID(自定义)
* @param {Object} context 当前上下文
* @param {Object} args 剩余参数
*/
18015(context, args) {
...
}
18016(context, args) {
...
}
...
}
```
Expand All @@ -82,20 +84,20 @@ export default {
<!-- 事件行为埋点(DOM) -->
<div v-track:18015.click="handleClick"></div>
<div v-track:18015.click="{ handleClick, item, index }"></div>
<div v-track:18015.click.async="{ handleSearch, searchResult }"></div>
<div v-track:18015.click.async="{ handleSearch, rest }"></div>
<div v-track:18015.click.delay="handleClick"></div>

<!-- 事件行为埋点(组件) -->
<cmp v-track:18015.click="handleClick"></cmp>
<cmp v-track:18015.[自定义事件名]="handleSearch"></cmp>
<cmp v-track:18015.[自定义事件名].delay="handleSearch"></cmp>
<cmp v-track:18015.[自定义事件名].async="{ handleSearch, searchResult }"></cmp>
<cmp v-track:18015.[自定义事件名].async="{ handleSearch, rest }"></cmp>

<!-- 区域展现埋点 -->
<cmp v-track:18015.show></cmp>
<cmp v-track:18015.show.once></cmp>
<cmp v-track:18015.show.custom="{ ref: 'scroll' }"></cmp>
<cmp v-track:18015.show.custom.once="{ ref: 'scroll' }"></cmp>
<!-- 区域展现埋点(block 可以是 DOM 或者组件) -->
<block v-track:18015.show></block>
<block v-track:18015.show.once></block>
<block v-track:18015.show.custom="{ ref: 'scroll' }"></block>
<block v-track:18015.show.custom.once="{ ref: 'scroll' }"></block>
```

## LICENSE
Expand Down
4 changes: 2 additions & 2 deletions src/utils/vis-monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: 宋慧武
* @Date: 2019-04-08 11:13:34
* @Last Modified by: 宋慧武
* @Last Modified time: 2019-04-08 12:00:05
* @Last Modified time: 2019-04-13 23:10:29
*/
import { isElement, isVisible, isInViewport } from "./dom";
import { isFun, debounce } from "./helper";
Expand All @@ -11,7 +11,7 @@ import { isFun, debounce } from "./helper";
* @class
* @name VisMonitor
*
* @deec 目标元素控制器
* @desc 目标元素控制器
*/
export default class VisMonitor {
constructor(ele, ref) {
Expand Down

0 comments on commit d4d21a6

Please sign in to comment.