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

怎么取消点击事件的向上冒泡 #581

Closed
HDP2017 opened this issue Jun 22, 2024 · 2 comments
Closed

怎么取消点击事件的向上冒泡 #581

HDP2017 opened this issue Jun 22, 2024 · 2 comments

Comments

@HDP2017
Copy link

HDP2017 commented Jun 22, 2024

Describe the issue

比如,图片的点击预览的点击,代码段的点击复制以及点击收起等这些事件,因为在组件的父级有其他点击监听,点了这几个事件后,会触发父级的事件,怎么配置可以处理这些?

Procedure version

vue3项目,4.16.7

Reproduction link

No response

@imzbf
Copy link
Owner

imzbf commented Jun 22, 2024

无法取消,建议你通过even.target判断触发事件的对象后选择是否执行操作

@HDP2017
Copy link
Author

HDP2017 commented Jun 24, 2024

好的,这样倒也可以解决问题,感谢。

@imzbf imzbf closed this as completed Jun 24, 2024
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