From 939a659234cf44bbdc45ab08d81b2722702adb9f Mon Sep 17 00:00:00 2001 From: xx <642578464@qq.com> Date: Fri, 16 May 2025 16:04:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(Editor):=20=E4=BF=AE=E5=A4=8D=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E7=BC=96=E8=BE=91=E5=99=A8=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E5=92=8C=E6=9B=B4=E6=96=B0=E5=86=85=E5=AE=B9=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20-=20=E5=9C=A8=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E5=92=8C=E6=9B=B4=E6=96=B0=E5=86=85=E5=AE=B9=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E4=BD=BF=E7=94=A8=20clipboard.dangerouslyPasteHTML=20?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E6=9B=BF=E4=BB=A3=20setContents=20-=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E9=80=9A=E7=9F=A5=E5=85=AC=E5=91=8A?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2=E6=97=A0=E6=B3=95=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=AF=8C=E6=96=87=E6=9C=AC=E5=86=85=E5=AE=B9=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Editor/index.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue index 0108392..2235476 100644 --- a/src/components/Editor/index.vue +++ b/src/components/Editor/index.vue @@ -124,7 +124,7 @@ watch(() => props.modelValue, val => { if (val !== currentValue) { currentValue = val === null ? "" : val; if (DataQuill) { - DataQuill.setContents(currentValue); + DataQuill.clipboard.dangerouslyPasteHTML(currentValue || ''); } } }, { immediate: true }) @@ -151,7 +151,7 @@ function init() { } console.log(DataQuill); - DataQuill.setContents(currentValue); + DataQuill.clipboard.dangerouslyPasteHTML(currentValue || ''); DataQuill.on("text-change", (delta, oldDelta, source) => { const html = editor.value.children[0].innerHTML; const text = DataQuill.getText(); @@ -304,4 +304,4 @@ function handleUploadError() { .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before { content: "等宽字体"; } - \ No newline at end of file + -- Gitee