Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于移动端图片点击需求 #840

Closed
xianjerry opened this issue Dec 12, 2020 · 1 comment
Closed

关于移动端图片点击需求 #840

xianjerry opened this issue Dec 12, 2020 · 1 comment
Assignees
Milestone

Comments

@xianjerry
Copy link

你在什么场景下需要该功能?

我在移动端打算使用vditor作为编辑器,但是一般移动端都是点击图片放大展示的功能,看了一下文档没有添加图片点击事件的方法。

现在我是在 option.preview.parse 函数内使用 getElementByTagName 获取全部图片标签并添加点击事件,然后调用原生的图片浏览器展示大图,这样也可以解决问题,但是好像不够优雅而已,目前正在看vditor源码中,而且对ts不是很熟悉,暂时还没有能力增加功能。

描述最优的解决方案

希望能增加一个图片点击事件函数:function(allImageSrcArray, index),allImageSrcArray是编辑器内所有渲染到的图片的集合,index是第几个图片点击了。

描述候选解决方案

就是上面像我那样使用 getElementByTagName 获取全部图片标签并添加点击事件

其他信息

@Vanessa219
Copy link
Owner

修改 siyuan-note/siyuan#609 的时候会一并进行内置支持。

@Vanessa219 Vanessa219 self-assigned this Dec 13, 2020
@Vanessa219 Vanessa219 added this to the 3.7 milestone Dec 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants