From daadcdcbc7f69b494add059881872c0b9f661a20 Mon Sep 17 00:00:00 2001 From: yinjiacheng Date: Fri, 30 Jun 2023 16:35:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Eweb-view=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hybrid/html/local.html | 112 ++++++++++++++++++ pages.json | 12 ++ .../web-view-local/web-view-local.uvue | 94 +++++++++++++++ pages/component/web-view/web-view.uvue | 99 ++++++++++++++++ pages/tabBar/component/component.uvue | 4 +- 5 files changed, 319 insertions(+), 2 deletions(-) create mode 100644 hybrid/html/local.html create mode 100644 pages/component/web-view-local/web-view-local.uvue create mode 100644 pages/component/web-view/web-view.uvue diff --git a/hybrid/html/local.html b/hybrid/html/local.html new file mode 100644 index 00000000..e379a6d4 --- /dev/null +++ b/hybrid/html/local.html @@ -0,0 +1,112 @@ + + + + + + 本地网页 + + + +

web-view 组件加载本地 html 示例,仅在 App 环境下生效。点击下列按钮,跳转至其它页面。

+
+ + + + + +
+

网页向应用发送消息。注意:小程序端应用会在此页面后退时接收到消息。

+
+ +
+ + + + + \ No newline at end of file diff --git a/pages.json b/pages.json index 82728a34..09e9b582 100644 --- a/pages.json +++ b/pages.json @@ -78,6 +78,18 @@ "navigationBarTitleText": "image" } }, + { + "path": "pages/component/web-view/web-view", + "style": { + "navigationBarTitleText": "web-view" + } + }, + { + "path": "pages/component/web-view-local/web-view-local", + "style": { + "navigationBarTitleText": "web-view-local" + } + }, { "path": "pages/tabBar/API/API", "style": { diff --git a/pages/component/web-view-local/web-view-local.uvue b/pages/component/web-view-local/web-view-local.uvue new file mode 100644 index 00000000..0309df1f --- /dev/null +++ b/pages/component/web-view-local/web-view-local.uvue @@ -0,0 +1,94 @@ + + + + + \ No newline at end of file diff --git a/pages/component/web-view/web-view.uvue b/pages/component/web-view/web-view.uvue new file mode 100644 index 00000000..c041fd94 --- /dev/null +++ b/pages/component/web-view/web-view.uvue @@ -0,0 +1,99 @@ + + + + + \ No newline at end of file diff --git a/pages/tabBar/component/component.uvue b/pages/tabBar/component/component.uvue index b6589d59..e0a90b7e 100644 --- a/pages/tabBar/component/component.uvue +++ b/pages/tabBar/component/component.uvue @@ -190,12 +190,12 @@ pages: [ { name: '网络网页', - enable: false, + enable: true, url: '/pages/component/web-view/web-view' }, { name: '本地网页', - enable: false, + enable: true, url: '/pages/component/web-view-local/web-view-local' } ] as Page[] -- GitLab