From 0b755ce0c66a0fe16605ca1a711ed9a0e455fcc7 Mon Sep 17 00:00:00 2001 From: sws <1141121512@qq.com> Date: Fri, 23 Aug 2024 17:54:24 +0800 Subject: [PATCH 1/3] =?UTF-8?q?1.=E4=BF=9D=E5=AD=98=E6=95=B0=E6=8D=AE=20sw?= =?UTF-8?q?s=202024-08-22?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model-rich-text/model-rich-text-content.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/model-rich-text/model-rich-text-content.vue b/src/components/model-rich-text/model-rich-text-content.vue index 1c114f48..1e52efac 100644 --- a/src/components/model-rich-text/model-rich-text-content.vue +++ b/src/components/model-rich-text/model-rich-text-content.vue @@ -6,9 +6,9 @@ - + - + @@ -24,6 +24,7 @@ const props = defineProps({ const form = reactive(props.value); const mode = ref('default'); // 编辑器模式 +const editorRef = ref(null); // 编辑器实例,必须用 shallowRef const editor_ref = shallowRef(); // 插入光标位置 @@ -89,7 +90,8 @@ const upload_list_change = (arry: uploadList[]) => { // editor.select(cursor_position.value); // // editor.deleteFragment(); - editor.dangerouslyInsertHtml(new_html); + // editor.dangerouslyInsertHtml(new_html); + console.log(editorRef); } upload_list.value = []; }; From d09dc925f17453a6df47210ecbc106b9ba001e02 Mon Sep 17 00:00:00 2001 From: sws <1141121512@qq.com> Date: Fri, 23 Aug 2024 17:59:27 +0800 Subject: [PATCH 2/3] =?UTF-8?q?1.=E5=AF=8C=E6=96=87=E6=9C=AC=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E6=9B=B4=E6=96=B0=20sws=202024-08-23?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/model-rich-text/index.vue | 5 +--- .../model-rich-text-content.vue | 23 +++++-------------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/src/components/model-rich-text/index.vue b/src/components/model-rich-text/index.vue index b7fb7bf1..6510a3a2 100644 --- a/src/components/model-rich-text/index.vue +++ b/src/components/model-rich-text/index.vue @@ -32,10 +32,7 @@ const safe_conten = computed(() => DOMPurify.sanitize(content.value)); .rich-text-content { white-space: normal; word-break: break-all; - img { - max-width: 100%; - } - video { + * { max-width: 100%; } } diff --git a/src/components/model-rich-text/model-rich-text-content.vue b/src/components/model-rich-text/model-rich-text-content.vue index 64d1ca03..822bde12 100644 --- a/src/components/model-rich-text/model-rich-text-content.vue +++ b/src/components/model-rich-text/model-rich-text-content.vue @@ -81,23 +81,15 @@ const upload_list_change = (arry: uploadList[]) => { arry.forEach((item: uploadList) => { const url = item.url; const alt = item.title; - // if (rich_upload_type.value === 'img') { - // new_html += `${alt}`; - // } else if (rich_upload_type.value === 'video') { - // new_html += `