From 2c6afff2e9044cf283f3c5e9fab2b089626ed137 Mon Sep 17 00:00:00 2001
From: mehaotian <490272692@qq.com>
Date: Thu, 25 Jan 2024 20:23:18 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=20teleprot=20?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=8F=8A=E7=A4=BA=E4=BE=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages.json | 8 ++
.../teleport/sub-container.uvue | 31 ++++++++
.../teleport/teleport.test.js | 17 ++++
.../built-in-component/teleport/teleport.uvue | 79 +++++++++++++++++++
pages/tab-bar/options-api.uvue | 10 ++-
5 files changed, 142 insertions(+), 3 deletions(-)
create mode 100644 pages/built-in-component/teleport/sub-container.uvue
create mode 100644 pages/built-in-component/teleport/teleport.test.js
create mode 100644 pages/built-in-component/teleport/teleport.uvue
diff --git a/pages.json b/pages.json
index 1ee6a3b..f64652f 100644
--- a/pages.json
+++ b/pages.json
@@ -622,6 +622,14 @@
{
"navigationBarTitleText" : "依赖注入"
}
+ },
+ {
+ "path" : "pages/built-in-component/teleport/teleport",
+ "style" :
+ {
+ "navigationBarTitleText" : "teleport",
+ "enablePullDownRefresh" : false
+ }
}
],
"tabBar": {
diff --git a/pages/built-in-component/teleport/sub-container.uvue b/pages/built-in-component/teleport/sub-container.uvue
new file mode 100644
index 0000000..5d014c4
--- /dev/null
+++ b/pages/built-in-component/teleport/sub-container.uvue
@@ -0,0 +1,31 @@
+
+
+
+ 红色区域为子组件
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/built-in-component/teleport/teleport.test.js b/pages/built-in-component/teleport/teleport.test.js
new file mode 100644
index 0000000..8af3070
--- /dev/null
+++ b/pages/built-in-component/teleport/teleport.test.js
@@ -0,0 +1,17 @@
+const PAGE_PATH = '/pages/built-in-component/teleport/teleport'
+
+describe('teleport', () => {
+ let page = null
+ beforeAll(async () => {
+ page = await program.reLaunch(PAGE_PATH)
+ await page.waitFor('view')
+ })
+
+ it('teleport', async () => {
+ await page.waitFor(500)
+ const image = await program.screenshot({
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot();
+ })
+})
diff --git a/pages/built-in-component/teleport/teleport.uvue b/pages/built-in-component/teleport/teleport.uvue
new file mode 100644
index 0000000..3f40c2d
--- /dev/null
+++ b/pages/built-in-component/teleport/teleport.uvue
@@ -0,0 +1,79 @@
+
+
+
+
+
+ .container 区域
+
+
+ content1 区域
+
+
+ content2 区域
+
+
+
+
+ 内容在.container中,使用teleport在#content1元素中展示
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/tab-bar/options-api.uvue b/pages/tab-bar/options-api.uvue
index f12e22c..67b4db5 100644
--- a/pages/tab-bar/options-api.uvue
+++ b/pages/tab-bar/options-api.uvue
@@ -64,9 +64,13 @@
name: '内置组件',
open: false,
pages: [
- {
- name: 'keepAlive',
- url: 'keep-alive',
+ {
+ name: 'keepAlive',
+ url: 'keep-alive',
+ enable: true,
+ },{
+ name: 'teleport',
+ url: 'teleport',
enable: true,
},
] as PageItem[],
--
GitLab