From 1cdd1c58f81204c928a87d99499bd602552b5209 Mon Sep 17 00:00:00 2001 From: yinjiacheng Date: Mon, 21 Aug 2023 20:38:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0web-view=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/component/web-view/web-view.uvue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pages/component/web-view/web-view.uvue b/pages/component/web-view/web-view.uvue index 19e8f17e..527f5817 100644 --- a/pages/component/web-view/web-view.uvue +++ b/pages/component/web-view/web-view.uvue @@ -23,6 +23,9 @@ + + + @@ -36,7 +39,7 @@ progress: { color: '#FF3333' } - } as UTSJSONObject + } } }, methods: { @@ -52,6 +55,9 @@ stop() { (this.$refs['web-view'] as IWebViewNode).stop(); }, + nativeToWeb() { + (this.$refs['web-view'] as IWebViewNode).evalJS("alert('hello uni-app x')"); + }, message(event : WebViewMessageEvent) { console.log(JSON.stringify(event.detail)); }, -- GitLab