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 1e52efac..64d1ca03 100644 --- a/src/components/model-rich-text/model-rich-text-content.vue +++ b/src/components/model-rich-text/model-rich-text-content.vue @@ -50,6 +50,7 @@ const editor_config = ref({ rich_upload_type.value = 'img'; visibleDialog.value = true; cursor_position.value = editor_ref.value.selection; + upload_insert.value = insertFn; }, }, uploadVideo: { @@ -58,10 +59,13 @@ const editor_config = ref({ rich_upload_type.value = 'video'; visibleDialog.value = true; cursor_position.value = editor_ref.value.selection; + upload_insert.value = insertFn; }, }, }, }); +// 获取到对应的触发事件 +const upload_insert = ref(null); const handle_created = (editor: any) => { editor_ref.value = editor; // 记录 editor 实例,重要! }; @@ -77,21 +81,23 @@ 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 += `