From 28dcd0599f4a145462a79b29acd783a88d1d404f Mon Sep 17 00:00:00 2001 From: YangFong Date: Tue, 20 Aug 2024 10:18:35 +0800 Subject: [PATCH] fix: insert table and upload images (#330) --- src/components/CodemirrorEditor/InsertFormDialog.vue | 4 ++-- src/views/CodemirrorEditor.vue | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/CodemirrorEditor/InsertFormDialog.vue b/src/components/CodemirrorEditor/InsertFormDialog.vue index 3c720f4..ade2f24 100644 --- a/src/components/CodemirrorEditor/InsertFormDialog.vue +++ b/src/components/CodemirrorEditor/InsertFormDialog.vue @@ -27,9 +27,9 @@ function insertTable() { store.editor.operation(() => { store.editor.replaceSelection(`\n${table}\n`, `end`) }) - // store.editorRefresh() + store.editorRefresh() resetVal() - // formatContent() + formatContent() toggleShowInsertFormDialog() } diff --git a/src/views/CodemirrorEditor.vue b/src/views/CodemirrorEditor.vue index c7f3861..bacdb55 100644 --- a/src/views/CodemirrorEditor.vue +++ b/src/views/CodemirrorEditor.vue @@ -182,6 +182,7 @@ function uploaded(imageUrl) { // 将 Markdown 形式的 URL 插入编辑框光标所在位置 editor.value.replaceSelection(`\n${markdownImage}\n`, cursor) ElMessage.success(`图片上传成功`) + formatContent() onEditorRefresh() } function uploadImage(file, cb) {