Skip to content

fix(#444)分屏预览情况在,本地图片粘贴后,无法立即加载的问题.#486

Open
WuxuFanhua wants to merge 1 commit intocodexu:devfrom
WuxuFanhua:fix_444
Open

fix(#444)分屏预览情况在,本地图片粘贴后,无法立即加载的问题.#486
WuxuFanhua wants to merge 1 commit intocodexu:devfrom
WuxuFanhua:fix_444

Conversation

@WuxuFanhua
Copy link
Contributor

增加分屏下,右侧预览的处理.vditor.vditor.preview?.element
看源码发现,分屏处理完成后,会有个1000ms延迟.会导致,重新请求图片,会报404错误,无法显示.
修改为,1100ms后,重新处理本地图片. (可以增加分屏模式判断,再执行这个.)
vditor index.js 12275行.
else {
var html = vditor.lute.Md2HTML(markdownText);
if (vditor.options.preview.transform) {
html = vditor.options.preview.transform(html);
}
_this.previewElement.innerHTML = html;
_this.afterRender(vditor, renderStartTime);
}
}, vditor.options.preview.delay);

@codexu
Copy link
Owner

codexu commented Aug 11, 2025

分屏这样处理可以正常展示,但是所见即所得和及时渲染效果不好,另外有没有不修改 vditor index.js 的方式吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants