vue-tracker
v1.1.3
Published
A track point directive for vue.js
Downloads
5
Maintainers
Readme
vue-tracker
A track point directive for vue.js
Requirements
- vue: ^2.0.0
Install
From npm:
$ npm install vue-tracker --save
Usage
v-track
import * as tracker from 'vue-tracker';
tracker.init(fetchFunction)
export default {
template: '<button v-track="{act:'click',data:{id:100}}">Save</button>',
};
mixin
import * as tracker from 'vue-tracker';
tracker.init(fetchFunction)
export default {
mixins: [ tracker.mixin ],
template: '<button @click="track(arguments,handleClick)({id:200},true)">Leave</button>/>',
};
API
// 1. ready: 进入指定页面时触发
// 2. click: 点击指定元素时触发
// 3. view: 指定区域眼球曝光时触发
// 4. unload: 离开指定页面时触发
param = {
t?: Enum {bind|update|unbind}
act: Enum {ready|click|view|unload}
data: {
id: eventId,
p?: [p1?, p2?, ...]
}