Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.

Commit 263d400

Browse files
committed
update demo.
1 parent 9ac71b2 commit 263d400

File tree

4 files changed

+32
-5
lines changed

4 files changed

+32
-5
lines changed

demo/js/main-for-vue2.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,27 @@ const app = new Vue({
3232
data () {
3333
return {
3434
pageUrl: '',
35+
fromUrl: '',
3536
category: '',
3637
action: '',
3738
label: '',
38-
value: ''
39+
value: '',
40+
nodeId: ''
3941
}
4042
},
4143
mounted () {
4244
},
4345
methods: {
4446
pv () {
45-
this.$pushCNZZ.pv(this.pageUrl);
47+
this.$pushCNZZ.pv(this.pageUrl, this.fromUrl);
4648
},
4749
event () {
4850
this.$pushCNZZ.event(
4951
this.category,
5052
this.action,
5153
this.label,
52-
this.value
54+
this.value,
55+
this.nodeId
5356
);
5457
}
5558
}

demo/js/main-for-vue3.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,19 @@ const app = {
2727

2828
// 初始化要用到的数据
2929
const pageUrl = ref('');
30+
const fromUrl = ref('');
3031
const category = ref('');
3132
const action = ref('');
3233
const label = ref('');
3334
const value = ref('');
35+
const nodeId = ref('');
3436

3537
// 提交pv的操作
3638
const pv = () => {
37-
proxy.$pushCNZZ.pv(pageUrl.value);
39+
proxy.$pushCNZZ.pv(
40+
pageUrl.value,
41+
fromUrl.value
42+
);
3843
}
3944

4045
// 提交事件的操作
@@ -43,18 +48,21 @@ const app = {
4348
category.value,
4449
action.value,
4550
label.value,
46-
value.value
51+
value.value,
52+
nodeId.value
4753
);
4854
}
4955

5056
// Vue 3.0 需要把模板要用到的东西 return 出去
5157
return {
5258
// 数据
5359
pageUrl,
60+
fromUrl,
5461
category,
5562
action,
5663
label,
5764
value,
65+
nodeId,
5866

5967
// 方法
6068
pv,

demo/vue2.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ <h2>提交pv测试</h2>
3333
<span class="text">pageUrl</span>
3434
<input class="input" type="text" placeholder="输入页面的url" v-model="pageUrl">
3535
</label>
36+
<label class="label">
37+
<span class="text">fromUrl</span>
38+
<input class="input" type="text" placeholder="输入来路的url" v-model="fromUrl">
39+
</label>
3640
<button class="button" @click="pv">提交一个pv</button>
3741
</section>
3842

@@ -54,6 +58,10 @@ <h2>提交event测试</h2>
5458
<span class="text">value</span>
5559
<input class="input" type="text" placeholder="输入该事件的分值" v-model="value">
5660
</label>
61+
<label class="label">
62+
<span class="text">nodeId</span>
63+
<input class="input" type="text" placeholder="输入产生该事件的元素id" v-model="nodeId">
64+
</label>
5765
<button class="button" @click="event">提交一个event</button>
5866
</section>
5967
</div>

demo/vue3.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ <h2>提交pv测试</h2>
3333
<span class="text">pageUrl</span>
3434
<input class="input" type="text" placeholder="输入页面的url" v-model="pageUrl">
3535
</label>
36+
<label class="label">
37+
<span class="text">fromUrl</span>
38+
<input class="input" type="text" placeholder="输入来路的url" v-model="fromUrl">
39+
</label>
3640
<button class="button" @click="pv">提交一个pv</button>
3741
</section>
3842

@@ -54,6 +58,10 @@ <h2>提交event测试</h2>
5458
<span class="text">value</span>
5559
<input class="input" type="text" placeholder="输入该事件的分值" v-model="value">
5660
</label>
61+
<label class="label">
62+
<span class="text">nodeId</span>
63+
<input class="input" type="text" placeholder="输入产生该事件的元素id" v-model="nodeId">
64+
</label>
5765
<button class="button" @click="event">提交一个event</button>
5866
</section>
5967
</div>

0 commit comments

Comments
 (0)