From 6e0322e2c75496d9484f9c9c70d8baa370e36a73 Mon Sep 17 00:00:00 2001 From: yinkang Date: Thu, 10 Jul 2025 10:48:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20bug=20=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/editor/TiptapEditor.vue | 1 + src/utils/common.js | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/editor/TiptapEditor.vue b/src/components/editor/TiptapEditor.vue index ab99563..adc3936 100644 --- a/src/components/editor/TiptapEditor.vue +++ b/src/components/editor/TiptapEditor.vue @@ -993,6 +993,7 @@ html[theme-mode='dark'] { outline: none; .tiptap.ProseMirror{ height: 100%; + white-space: pre-wrap; } .image-upload-loading { position: relative; diff --git a/src/utils/common.js b/src/utils/common.js index f345b6c..3835ae4 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -52,14 +52,14 @@ export function throttle(fn, delay, call = function () {}) { * @param {String} text 复制内容 * @param {Function} callback 复制成功回调方法 */ -export function clipboard(text, callback) { +export async function clipboard(text, callback) { // 在wujie环境下使用主应用的clipboard const clipboardObj = window.__POWERED_BY_WUJIE__ ? window.parent.navigator.clipboard : navigator.clipboard try { clipboardObj - ?.writeText(text) + .writeText(text) .then(() => { callback && callback() }) @@ -68,7 +68,7 @@ export function clipboard(text, callback) { }) } catch (e) { console.error(e) - toClipboard(text) + await toClipboard(text) callback && callback() } } -- 2.45.2