提交 09013a92 编写于 作者: H hdx

fix(web-view示例): 调整调用uni API方式,使用uni.webView前缀, uni.xxx 改为 uni.webView.xxx

上级 d13d1f55
......@@ -55,29 +55,29 @@
console.log(action);
switch (action) {
case 'switchTab':
uni.switchTab({
uni.webView.switchTab({
url: '/pages/tabBar/API'
});
break;
case 'reLaunch':
uni.reLaunch({
uni.webView.reLaunch({
url: '/pages/tabBar/component'
});
break;
case 'navigateBack':
uni.navigateBack({
uni.webView.navigateBack({
delta: 1
});
break;
case 'getEnv':
uni.getEnv((res) => {
uni.webView.getEnv((res) => {
uni.postMessage({
data: res
})
});
break;
default:
uni[action]({
uni.webView[action]({
url: '/pages/component/button/button'
});
break;
......@@ -86,7 +86,7 @@
})
// });
document.querySelector("#postMessage").addEventListener('click', function() {
uni.postMessage({
uni.webView.postMessage({
data: {
action: 'message'
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册