Merge remote-tracking branch 'origin/dev-yxl' into dev-sws

v1.0.0
sws 2024-08-23 17:55:06 +08:00
commit 281614cb1e
1 changed files with 13 additions and 7 deletions

View File

@ -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<any>(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 += `<img src="${url}" alt="${alt}" />`;
} else if (rich_upload_type.value === 'video') {
new_html += `<video src="${url}" />`;
}
// if (rich_upload_type.value === 'img') {
// new_html += `<img src="${url}" alt="${alt}" />`;
// } else if (rich_upload_type.value === 'video') {
// new_html += `<video src="${url}" />`;
// }
//
upload_insert.value(url, alt);
});
//
upload_insert.value = null;
//
console.log(editor);
// if (editor.isDisabled()) editor.enable();
// if (!editor.isFocused()) editor.focus();
// editor.select(cursor_position.value);
// // editor.deleteFragment();
// editor.dangerouslyInsertHtml(new_html);
console.log(editorRef);
}
upload_list.value = [];
};