parent
6d1b9eab6c
commit
56143952c4
|
@ -62,6 +62,7 @@ const debounceOnUpdate = () => {
|
||||||
|
|
||||||
// 选取附件后处理
|
// 选取附件后处理
|
||||||
const attachmentSelect = (attachments: AttachmentLike[]) => {
|
const attachmentSelect = (attachments: AttachmentLike[]) => {
|
||||||
|
setCursor(lastSelectionRange);
|
||||||
// Reference https://github.com/guqing/willow-mde/blob/4b8e697132f8a8f4b08dd0f92cf10d070cb26793/console/src/components/toolbar/Toolbar.vue#L104
|
// Reference https://github.com/guqing/willow-mde/blob/4b8e697132f8a8f4b08dd0f92cf10d070cb26793/console/src/components/toolbar/Toolbar.vue#L104
|
||||||
attachments.forEach((attachment) => {
|
attachments.forEach((attachment) => {
|
||||||
if (typeof attachment === "string") {
|
if (typeof attachment === "string") {
|
||||||
|
@ -129,7 +130,10 @@ onMounted(async () => {
|
||||||
vditorLoaded.value = true;
|
vditorLoaded.value = true;
|
||||||
},
|
},
|
||||||
input: debounceOnUpdate,
|
input: debounceOnUpdate,
|
||||||
showAttachment: () => (attachmentSelectorModalShow.value = true),
|
showAttachment: () => {
|
||||||
|
lastSelectionRange = getCursor();
|
||||||
|
attachmentSelectorModalShow.value = true;
|
||||||
|
},
|
||||||
language: lang,
|
language: lang,
|
||||||
codeBlockPreview: editorConfig.value.basic.codeBlockPreview,
|
codeBlockPreview: editorConfig.value.basic.codeBlockPreview,
|
||||||
uploadImage: (files: File[]) => {
|
uploadImage: (files: File[]) => {
|
||||||
|
|
Loading…
Reference in New Issue