From db2ec5b85282ea7c5bf85a3807999e6639c873a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=91=9E?= Date: Fri, 1 Jul 2022 16:50:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=86=E7=A6=BBcopyable=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E5=8A=A8=E4=BD=9C=EF=BC=8C=E4=B8=8D=E5=86=8D=E5=86=92?= =?UTF-8?q?=E6=B3=A1=E8=87=B3=E7=88=B6=E7=BA=A7=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/typography/Base.tsx | 1 + components/typography/demo/interactive.vue | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/components/typography/Base.tsx b/components/typography/Base.tsx index 2650871ec0..d4761ff57b 100644 --- a/components/typography/Base.tsx +++ b/components/typography/Base.tsx @@ -233,6 +233,7 @@ const Base = defineComponent({ // ================ Copy ================ function onCopyClick(e: MouseEvent) { e.preventDefault(); + e.stopPropagation(); const { copyable } = props; const copyConfig = { diff --git a/components/typography/demo/interactive.vue b/components/typography/demo/interactive.vue index b20e77fdc5..50c8420717 100644 --- a/components/typography/demo/interactive.vue +++ b/components/typography/demo/interactive.vue @@ -53,7 +53,9 @@ Provide additional interactive capacity of editable and copyable. :editable="{ maxlength: 50, autoSize: { maxRows: 5, minRows: 3 } }" /> - This is a copyable text. + + This is a copyable text. + Replace copy text. @@ -87,6 +89,11 @@ export default defineComponent({ SmileFilled, CheckOutlined, }, + methods: { + handleClick(e) { + console.log(e); + }, + }, setup() { const editableStr = ref('This is an editable text.'); watch(editableStr, () => { From 6c0904fc2d81da37fe0dcfb65d7e09b447ef1fe3 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Thu, 1 Sep 2022 14:08:04 +0800 Subject: [PATCH 2/2] Update interactive.vue --- components/typography/demo/interactive.vue | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/components/typography/demo/interactive.vue b/components/typography/demo/interactive.vue index 50c8420717..b20e77fdc5 100644 --- a/components/typography/demo/interactive.vue +++ b/components/typography/demo/interactive.vue @@ -53,9 +53,7 @@ Provide additional interactive capacity of editable and copyable. :editable="{ maxlength: 50, autoSize: { maxRows: 5, minRows: 3 } }" /> - - This is a copyable text. - + This is a copyable text. Replace copy text. @@ -89,11 +87,6 @@ export default defineComponent({ SmileFilled, CheckOutlined, }, - methods: { - handleClick(e) { - console.log(e); - }, - }, setup() { const editableStr = ref('This is an editable text.'); watch(editableStr, () => {