Vanessa219 / vditor

♏ 一款浏览器端的 Markdown 编辑器,支持所见即所得(富文本)、即时渲染(类似 Typora)和分屏预览模式。An In-browser Markdown editor, support WYSIWYG (Rich Text), Instant Rendering (Typora-like) and Split View modes.
https://b3log.org/vditor
MIT License
8.04k stars 838 forks source link

改善图片预览 #1220

Open de1ck opened 2 years ago

de1ck commented 2 years ago

PreviewImage 没有提供缩等功能,可不可以提供一个开关用于关闭默认previewImage的功能,目前是通过css隐藏

Vanessa219 commented 2 years ago

看需求,如果优化图片预览功能,关闭就应该不需要了吧?

de1ck commented 2 years ago

看需求,如果优化图片预览功能,关闭就应该不需要了吧?

编辑模式下,默认是开启图片预览功能的,而且我没有找到关闭入口

Vanessa219 commented 2 years ago

那就加强一下图片预览功能吧

ryanlin1986 commented 5 months ago

image

是这个吗?可以关闭预览,我们的场景有特殊需求,项目中内置了高级图片预览所以通过这个把内置的给禁用掉。

Vanessa219 commented 5 months ago

会先判断 preview 方法,然后再判断是否启用。

           if (vditor.options.image.preview) {
                vditor.options.image.preview(event.target);
            } else if (vditor.options.image.isPreview) {
                previewImage(event.target as HTMLImageElement, vditor.options.lang, vditor.options.theme);
            }