From 80990e269593869f93c3b46b784e294a6c4da34e Mon Sep 17 00:00:00 2001 From: yinjiacheng Date: Mon, 4 Sep 2023 16:04:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0rich-text=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/component/rich-text/rich-text-complex.uvue | 11 ++++++++++- pages/component/rich-text/rich-text-tags.uvue | 9 +++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/pages/component/rich-text/rich-text-complex.uvue b/pages/component/rich-text/rich-text-complex.uvue index 5df1bafb..73b1518c 100644 --- a/pages/component/rich-text/rich-text-complex.uvue +++ b/pages/component/rich-text/rich-text-complex.uvue @@ -18,12 +18,21 @@ data() { return { title: 'rich-text-complex', - htmlString: '

HBuilderX

HBuilderX,轻巧、极速,极客编辑器

HBuilderX,轻巧、极速,极客编辑器 HBuilderX,轻巧、极速,极客编辑器HBuilderX,轻巧、极速,极客编辑器 HBuilderX,轻巧、极速,极客编辑器 HBuilderX,轻巧、极速,极客编辑器HBuilderX,轻巧、极速,极客编辑器

uni-app x,终极跨平台方案

uni-app x,终极跨平台方案 uni-app x,终极跨平台方案 uni-appx,终极跨平台方案 uni-app x,终极跨平台方案 uni-app x,终极跨平台方案 uni-app x,终极跨平台方案

uniCloud,js serverless云服务

uniCloud,js serverless云服务 uniCloud,js serverless云服务uniCloud,js serverless云服务 uniCloud,js serverless云服务 uniCloud,js serverless云服务uniCloud,js serverless云服务

uts,大一统语言

uts,大一统语言 uts,大一统语言 uts,大一统语言 uts,大一统语言uts,大一统语言 uts,大一统语言

uniMPSdk,让你的App具备小程序能力
uni-admin,开源、现成的全端管理后台
uni-app

' + htmlString: '

HBuilderX

HBuilderX,轻巧、极速,极客编辑器

HBuilderX,轻巧、极速,极客编辑器 HBuilderX,轻巧、极速,极客编辑器HBuilderX,轻巧、极速,极客编辑器HBuilderX,轻巧、极速,极客编辑器 HBuilderX,轻巧、极速,极客编辑器HBuilderX,轻巧、极速,极客编辑器

uni-app x,终极跨平台方案

uni-app x,终极跨平台方案 uni-app x,终极跨平台方案uni-appx,终极跨平台方案 uni-app x,终极跨平台方案 uni-app x,终极跨平台方案 uni-appx,终极跨平台方案

uniCloud,js serverless云服务

uniCloud,js serverless云服务 uniCloud,jsserverless云服务uniCloud,js serverless云服务 uniCloud,js serverless云服务 uniCloud,jsserverless云服务uniCloud,js serverless云服务

uts,大一统语言

uts,大一统语言 uts,大一统语言 uts,大一统语言uts,大一统语言uts,大一统语言 uts,大一统语言

uniMPSdk,让你的App具备小程序能力
uni-admin,开源、现成的全端管理后台
uni-app

' } }, methods: { itemClick(e : RichTextItemClickEvent) { console.log(JSON.stringify(e.detail)); + let title = ''; + if (e.detail.src != null) { + title = '点击了图片,src = ' + e.detail.src; + } else if (e.detail.href != null) { + title = '点击了链接,href = ' + e.detail.href; + } + uni.showModal({ + title: title + }); } } } diff --git a/pages/component/rich-text/rich-text-tags.uvue b/pages/component/rich-text/rich-text-tags.uvue index e7569796..71221c39 100644 --- a/pages/component/rich-text/rich-text-tags.uvue +++ b/pages/component/rich-text/rich-text-tags.uvue @@ -301,6 +301,15 @@ methods: { itemClick(e : RichTextItemClickEvent) { console.log(JSON.stringify(e.detail)); + let title = ''; + if (e.detail.src != null) { + title = '点击了图片,src = ' + e.detail.src; + } else if (e.detail.href != null) { + title = '点击了链接,href = ' + e.detail.href; + } + uni.showModal({ + title: title + }); } } } -- GitLab