From 09013a9259a25ae8b97b4b9f1d56e637df587b08 Mon Sep 17 00:00:00 2001 From: hdx Date: Tue, 17 Oct 2023 16:47:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(web-view=E7=A4=BA=E4=BE=8B):=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E8=B0=83=E7=94=A8uni=20API=E6=96=B9=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E4=BD=BF=E7=94=A8uni.webView=E5=89=8D=E7=BC=80=EF=BC=8C=20uni.?= =?UTF-8?q?xxx=20=E6=94=B9=E4=B8=BA=20uni.webView.xxx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hybrid/html/local.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hybrid/html/local.html b/hybrid/html/local.html index a42893de..a07951b2 100644 --- a/hybrid/html/local.html +++ b/hybrid/html/local.html @@ -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' } -- GitLab