From cc61263c97b0b94dd7884f547b581160a1572434 Mon Sep 17 00:00:00 2001 From: jacky Date: Wed, 22 May 2024 18:04:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BA=AF=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E5=A4=8D=E5=88=B6=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/richtext/rich-edit.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/richtext/rich-edit.vue b/src/components/richtext/rich-edit.vue index 7d1c586..63349e3 100644 --- a/src/components/richtext/rich-edit.vue +++ b/src/components/richtext/rich-edit.vue @@ -76,12 +76,15 @@ const handleCreated = (editor) => { } const customPaste = (editor, event, callback) => { - console.log(event) + // console.log(event) // 显示蒙版 loadingShow.value = true - let htmlData = event.clipboardData.getData('text/html') // 获取粘贴的 html - console.log(htmlData) + // console.log(htmlData) + if (htmlData == "") { + htmlData = event.clipboardData.getData('text/plain') // 获取粘贴的 html + // console.log(htmlData) + } let rtfData = event.clipboardData.getData('text/rtf') // 获取粘贴的 html // console.log('-------------- rtfData --------------', rtfData)