fix: 修复编辑模式下 Vditor 不加载稿件内容

- 创作中心编辑文章时,after 回调中显式调用 vditor.setValue(initialMD)
- 修复 Vditor 3.x wysiwyg 模式下 value 选项可能不渲染内容的问题
This commit is contained in:
2026-05-30 21:29:29 +08:00
parent 67444434b9
commit 53f84bfcc4

View File

@ -85,6 +85,9 @@ document.addEventListener('DOMContentLoaded', () => {
after() { after() {
if (!isEdit) { if (!isEdit) {
setTimeout(() => restoreDraft(), 100) setTimeout(() => restoreDraft(), 100)
} else if (initialMD) {
// 编辑模式:显式设置稿件内容,确保正确加载
vditor.setValue(initialMD)
} }
updateWordCount() updateWordCount()
}, },