@iwux/webview
v1.0.83
Published
<!-- .json --> { "usingComponents": { "wux-webview": "@iwux/webview" } }
Downloads
5
Readme
usage
{ "usingComponents": { "wux-webview": "@iwux/webview" } }
Page({ data:{ webviewConfigs: { src: 'https://m.ly.com', title: '', backgroundColor: '', // 配置导航 frontColor: '', hideShareMenu: false, shareConfigs: {}, // 配置分享 isThirdUrl: false, // 第三方页面,则不会在 src 地址上拼接参数 appendNewCode: false, // 添加code }, }, onLoad(options) { const src = decodeURIComponent(options && options.src || ''); const { webviewConfigs } = this.data; webviewConfigs.src = src; this.setData({ webviewConfigs }); }, onBindmessage(e){ const cbData = e.detail; if (Object.keys(cbData).length) { attachStackData(cbData); } }, });
Page({
onShow() {
const cbData = getStackData();
if (Object.keys(cbData).length) {
console.log('== postMessage callBack', cbData);
}
},
openWebview() {
wx.navigateTo({
url: /webview/index?src=${encodeURIComponent('https://jr.qa.ly.com/webapps/baitiao/wxapp/_tools/index-dev?env=inte')},
});
},
});
