fix: 监听change事件 解决上传后不操作无法触发回调

This commit is contained in:
dap
2025-10-15 10:15:36 +08:00
parent 7844a3c7e6
commit 4fee98ea58

View File

@@ -173,8 +173,11 @@ const initOptions = computed((): InitOptions => {
});
// 监听内容变化,处理待附加 data-oss-id 的图片
editor.on('NodeChange', () => {
if (pendingImageMap.size === 0) return;
editor.on('change', () => {
if (pendingImageMap.size === 0) {
return;
}
pendingImageMap.forEach((ossId, url) => {
const imgDoms = editor.dom.select(`img[src="${url}"]`);
if (imgDoms && imgDoms.length > 0) {