From 7b39c08414329b81597e38dff7a43e2e24d689f2 Mon Sep 17 00:00:00 2001 From: hdx Date: Wed, 17 Jan 2024 18:01:32 +0800 Subject: [PATCH] =?UTF-8?q?canvas:=20=E7=A7=BB=E5=8A=A8=E5=88=B0=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=20tab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 16 +++---- pages/tabBar/component.uvue | 42 +++++++++---------- pages/tabBar/template.uvue | 9 ++++ .../browser-canvas/browser-canvas.uvue} | 2 +- 4 files changed, 37 insertions(+), 32 deletions(-) rename pages/{component/canvas/canvas.uvue => template/browser-canvas/browser-canvas.uvue} (96%) diff --git a/pages.json b/pages.json index 1ed8e3b3..e0f6ad83 100644 --- a/pages.json +++ b/pages.json @@ -234,14 +234,6 @@ "navigationBarTitleText": "redirectPage" } }, - // #ifdef WEB - { - "path": "pages/component/canvas/canvas", - "style": { - "navigationBarTitleText": "canvas" - } - }, - // #endif { "path": "pages/component/web-view/web-view", "style": { @@ -1115,6 +1107,14 @@ "navigationBarTitleText": "自定义TabBar" } }, + // #ifdef WEB + { + "path": "pages/template/browser-canvas/browser-canvas", + "style": { + "navigationBarTitleText": "如何使用浏览器 canvas" + } + }, + // #endif // #ifdef APP { "path": "pages/template/calendar/calendar", diff --git a/pages/tabBar/component.uvue b/pages/tabBar/component.uvue index f22fccc7..343d35eb 100644 --- a/pages/tabBar/component.uvue +++ b/pages/tabBar/component.uvue @@ -182,29 +182,25 @@ }, */ ] as Page[], }, - /* - { - id: 'map', - name: '地图', - pages: [ - { - name: 'map', - enable: false - } - ] as Page[] - }, - */ - // #ifdef WEB - { - id: 'canvas', - name: '画布', - pages: [ - { - name: 'canvas' - } - ] as Page[] - }, - // #endif + // { + // id: 'map', + // name: '地图', + // pages: [ + // { + // name: 'map', + // enable: false + // } + // ] as Page[] + // }, + // { + // id: 'canvas', + // name: '画布', + // pages: [ + // { + // name: 'canvas' + // } + // ] as Page[] + // }, { id: 'web-view', name: '网页', diff --git a/pages/tabBar/template.uvue b/pages/tabBar/template.uvue index 9226b7d8..c6f06dfc 100644 --- a/pages/tabBar/template.uvue +++ b/pages/tabBar/template.uvue @@ -185,6 +185,15 @@ open: false, pages: [] as Page[], }, + // #endif + // #ifdef WEB + { + id: 'browser-canvas', + url: 'browser-canvas', + name: '如何使用浏览器 canvas', + open: false, + pages: [] as Page[], + }, // #endif ] as ListItem[], arrowUpIcon: '/static/icons/arrow-up.png', diff --git a/pages/component/canvas/canvas.uvue b/pages/template/browser-canvas/browser-canvas.uvue similarity index 96% rename from pages/component/canvas/canvas.uvue rename to pages/template/browser-canvas/browser-canvas.uvue index a58b4b15..d6acce98 100644 --- a/pages/component/canvas/canvas.uvue +++ b/pages/template/browser-canvas/browser-canvas.uvue @@ -12,7 +12,7 @@ export default { data() { return { - title: 'Canvas', + title: '浏览器 canvas', drawing: null as UniElement | null, canvasElement: null as HTMLCanvasElement | null, canvasContext: null as CanvasRenderingContext2D | null, -- GitLab