Skip to content

Commit

Permalink
add web-collect/4.md
Browse files Browse the repository at this point in the history
  • Loading branch information
deepraining committed May 25, 2020
1 parent 8f235fa commit 3dd038a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web-collect/4.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function initOnload() {
a(b)
}
}
```
```

按理说,前后两次对 `Page` 进行重写,应该是不冲突、都有效的,但 `uni-app` 在对 Vue 组件转微信小程序原生组件时,使用了局部封装的函数,导致后面其他脚本对 `Page` 的重写无效

Expand Down Expand Up @@ -78,7 +78,7 @@ function createPage(vuePageOptions) {
- }
+ import Vue from 'vue';
+
+
+ function initOnload() {
+ // 重写 Vue.prototype.__call_hook 方法
+ Vue.prototype.__call_hook_proxy = Vue.prototype.__call_hook;
Expand All @@ -96,7 +96,7 @@ function createPage(vuePageOptions) {
+ }
```

改写后的 [mta-wechat-analysis.js](../resources/mta-wechat-analysis.js) 脚本可以[点这里下载](../resources/mta-wechat-analysis.js)
改写后的 [mta-wechat-analysis.js](../resources/mta-wechat-analysis.js) 脚本可以[点这里下载](../resources/mta-wechat-analysis.js)

## 后续

Expand Down

0 comments on commit 3dd038a

Please sign in to comment.