Skip to content

Commit 7727c61

Browse files
committed
fix(#444)分屏预览情况在,本地图片粘贴后,无法立即加载的问题.
1 parent 3349b2b commit 7727c61

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/app/core/article/md-editor.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@ export function MdEditor() {
124124
input: (value) => {
125125
saveCurrentArticle(value)
126126
emitter.emit('editor-input')
127-
handleLocalImage(vditor)
127+
setTimeout(() => {
128+
handleLocalImage(vditor)
129+
}, 1100)
130+
128131
},
129132
mode: localMode,
130133
upload: {
@@ -193,7 +196,7 @@ export function MdEditor() {
193196
// 处理本地相对路径图片
194197
async function handleLocalImage(vditor: Vditor) {
195198
const workspace = await getWorkspacePath()
196-
const previews = [vditor.vditor.ir?.element, vditor.vditor.sv?.element, vditor.vditor.wysiwyg?.element]
199+
const previews = [vditor.vditor.ir?.element, vditor.vditor.sv?.element, vditor.vditor.wysiwyg?.element,vditor.vditor.preview?.element]
197200
previews.forEach(element => {
198201
element?.querySelectorAll('img').forEach(async (img) => {
199202
let src = img.getAttribute('src')

0 commit comments

Comments
 (0)