hinesboy / mavonEditor

mavonEditor - A markdown editor based on Vue that supports a variety of personalized features
http://www.mavoneditor.com/
MIT License
6.38k stars 916 forks source link

$vm.$refs.toolbar_left.$imgDelByFilename相关问题 #857

Open insDream opened 1 year ago

insDream commented 1 year ago

🐛 Bug Report

Steps To Reproduce 我在回显页面的时候,通过

let fileName = url.slice(url.lastIndexOf("/") + 1);
                    this.coverUrlToFile(url, fileName).then((file) => {
                        this.$refs.md.$refs.toolbar_left.$imgAddByFilename(
                            fileName,
                            file
                        );
                    });

添加从服务端得来的imgurl,从而使img_file回显,再点击列表中的删除按钮时调用$vm.$refs.toolbar_left.$imgDelByFilename进行删除,浏览器显示会循环调用这个方法

并在报错之后把img_file中的所有内容都删除

Screenshots image

The expected behaviour

在调用$imgDelByFilename后可以正常删除img_file中的列表,并且可以吧md源码中对应的图片删除

Possible solution (optional, but very helpful)