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

Vue子组件添加点击事件无效_Acid_lemon的博客-CSDN博客 #206

Open
xiaodongxier opened this issue Sep 4, 2023 · 0 comments
Open

Comments

@xiaodongxier
Copy link
Owner

在vue中使用组件,给该组件添加点击事件,点击该组件无效。

原因
在组件上绑定事件,你不加 .native修饰符 告诉它是这是原生点击事件,它会以为这是你定义的自定义事件。

解决方法
给点击事件加 .native

<svg-icon icon-class='synchronization' class-name="icon" @click.native="deleteIssue()"></svg-icon>

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

1 participant