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

子节点如果为被div包裹的img,则无法触发点击预览 #187

Open
nonhana opened this issue Jun 26, 2024 · 1 comment
Open

子节点如果为被div包裹的img,则无法触发点击预览 #187

nonhana opened this issue Jun 26, 2024 · 1 comment

Comments

@nonhana
Copy link

nonhana commented Jun 26, 2024

如题,我封装了一个自定义的图片懒加载组件,其中 img 标签外层有一层 div ,这样便无法触发预览。可以采用什么方法解决?

@MinJieLiu
Copy link
Owner

如果是自定义组件则需要保证 onClick 事件能正常触发,转发 ref 到 HTMLElement 上保证打开/关闭动画源的正确性

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants