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() } }