a3892636 by simon

no message

1 parent cee15072
......@@ -20,6 +20,7 @@
"pages/sign-in-record/sign-in-record",
"pages/rank/rank",
"pages/rank-gift/rank-gift",
"pages/webview/webview",
"pages/example/example",
"pages/more/more"
],
......
......@@ -4,7 +4,7 @@ Page({
isShow: false, // 控制组件显示隐藏
url: ''
},
onLoad: function (options = {}) {
onLoad(options = {}) {
let url = options.url;
if (url) {
this.setData({
......@@ -17,5 +17,9 @@ Page({
title: 'none',
});
}
},
onBindMessage(e) {
console.log("webview message:", e);
}
})
......
......@@ -4,4 +4,4 @@
<view class="text">加载中...</view>
</view>
</view>
<web-view wx:if="{{isShow}}" src="{{url}}" bindload="loadSucc"/>
<web-view wx:if="{{isShow}}" src="{{url}}" bindload="loadSucc" bindmessage="onBindMessage" />
......