From 0857d4bcee5e4201a117b87caa94a6629af035de Mon Sep 17 00:00:00 2001 From: 董国庆 <364620639@qq.com> Date: 星期一, 21 四月 2025 17:20:20 +0800 Subject: [PATCH] 引入富文本框 --- src/components/AiEditor/index.vue | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/AiEditor/index.vue b/src/components/AiEditor/index.vue index 1f04380..c0bc236 100644 --- a/src/components/AiEditor/index.vue +++ b/src/components/AiEditor/index.vue @@ -54,7 +54,7 @@ watch: { value: { handler(newVal) { - if (this.editor && newVal !== this.editor.getContent()) { + if (this.editor && newVal !== this.editor.getHtml()) { this.editor.setContent(newVal) } }, @@ -95,7 +95,9 @@ // 禁用 AI 功能 ai: false, // 禁用调整大小功能 - resize: false + resize: false, + // 添加唯一标识 + id: `editor-${Date.now()}-${Math.random().toString(36).substr(2, 9)}` } try { @@ -112,7 +114,7 @@ }, // 获取编辑器内容 getContent() { - return this.editor ? this.editor.getContent() : '' + return this.editor ? this.editor.getHtml() : '' }, // 设置编辑器内容 setContent(content) { -- Gitblit v1.7.1