fix: 监听change事件 解决上传后不操作无法触发回调
This commit is contained in:
parent
7844a3c7e6
commit
4fee98ea58
@ -173,8 +173,11 @@ const initOptions = computed((): InitOptions => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 监听内容变化,处理待附加 data-oss-id 的图片
|
// 监听内容变化,处理待附加 data-oss-id 的图片
|
||||||
editor.on('NodeChange', () => {
|
editor.on('change', () => {
|
||||||
if (pendingImageMap.size === 0) return;
|
if (pendingImageMap.size === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pendingImageMap.forEach((ossId, url) => {
|
pendingImageMap.forEach((ossId, url) => {
|
||||||
const imgDoms = editor.dom.select(`img[src="${url}"]`);
|
const imgDoms = editor.dom.select(`img[src="${url}"]`);
|
||||||
if (imgDoms && imgDoms.length > 0) {
|
if (imgDoms && imgDoms.length > 0) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user