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

在 taro3 中使用,图片点击事件不触发 #344

Closed
ZhangJiL opened this issue Aug 18, 2021 · 6 comments
Closed

在 taro3 中使用,图片点击事件不触发 #344

ZhangJiL opened this issue Aug 18, 2021 · 6 comments
Labels
question Further information is requested

Comments

@ZhangJiL
Copy link

使用如下: <mp-html content={htmlContent} onImgtap={tapImg} /> 现在内容可以正常显示,但是图片的点击事件一直不触发。

@jin-yufeng
Copy link
Owner

提供可复现的 demo 项目

@ZhangJiL
Copy link
Author

ZhangJiL commented Aug 19, 2021

demo 地址

你好,现在发现问题出在了图片 src 属性上,详情见 demo 。谢谢

@jin-yufeng
Copy link
Owner

试了一下,taro 里这样引入图片会被转为 base64,然后目前的设计上是屏蔽 base64 图片的事件的,详见 #249

@ZhangJiL
Copy link
Author

了解,谢谢。现在遇到另外一个问题, preview-img 设置为 false ,但是点击图片还是会弹出预览。可参考之前的 demo

@jin-yufeng
Copy link
Owner

写成 previewImg 吧,preview-img taro 好像识别不到

@ZhangJiL
Copy link
Author

谢谢,可以实现效果

@jin-yufeng jin-yufeng added the question Further information is requested label Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants