From 6d9db730810604d5ca4f4d8a7410277be0300119 Mon Sep 17 00:00:00 2001 From: jixinbao Date: Wed, 23 Oct 2024 20:27:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20rich-text=20=E9=BB=98=E8=AE=A4=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20click=20=EF=BC=8C=E7=88=B6=E5=AE=B9=E5=99=A8?= =?UTF-8?q?=E7=9B=B8=E5=BA=94=20click=20=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/component/rich-text/rich-text.test.js | 8 ++++++++ pages/component/rich-text/rich-text.uvue | 12 ++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/pages/component/rich-text/rich-text.test.js b/pages/component/rich-text/rich-text.test.js index a68cb598..14b0f7d0 100644 --- a/pages/component/rich-text/rich-text.test.js +++ b/pages/component/rich-text/rich-text.test.js @@ -55,4 +55,12 @@ describe('rich-text-test', () => { }); }); + it('rich-text parent click', async () => { + const element = await page.$('#rich-text-parent') + await element.tap() + await page.waitFor(500) + const element2 = await page.$('#rich-text-str') + expect(await element2.text()).toBe("true") + }) + }) diff --git a/pages/component/rich-text/rich-text.uvue b/pages/component/rich-text/rich-text.uvue index dbe8ddcd..6b3298b6 100644 --- a/pages/component/rich-text/rich-text.uvue +++ b/pages/component/rich-text/rich-text.uvue @@ -16,9 +16,13 @@ selectable - + + + rich-text-parent + {{richTextStr}} + @@ -35,7 +39,8 @@ // 自动化测试 autoTest: false, testNodes: '', - isItemClickTrigger: false + isItemClickTrigger: false, + richTextStr: false } }, onReady() { @@ -71,6 +76,9 @@ }, getWindowInfoForTest() : GetWindowInfoResult { return uni.getWindowInfo(); + }, + richTextParentClick() { + this.richTextStr = true; } } } -- GitLab