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

自定义组件点击事件无法触发 #3259

Closed
jin-yufeng opened this issue Feb 19, 2022 · 3 comments
Closed

自定义组件点击事件无法触发 #3259

jin-yufeng opened this issue Feb 19, 2022 · 3 comments
Assignees

Comments

@jin-yufeng
Copy link

问题描述
自定义组件点击事件无法触发

复现步骤

<template>
	<view>
		<aa @tap="customTap"></aa>
	</view>
</template>

<script>
	export default {
		data() {
			return {}
		},
		methods: {
			customTap(e) {
				console.log('customTap', e)
			}
		}
	}
</script>

aa 是一个自定义组件,点击 aa

预期结果
触发点击事件

实际结果
h5app 不触发事件,微信小程序可以触发,但事件信息是 undefined

系统信息:

  • HBuilderX版本 3.3.11
@fxy060608
Copy link
Collaborator

fxy060608 commented Feb 21, 2022

vue2自定义组件如果要监听原生事件,需要加.native修饰符,即:@tap.native="customTap"
目前 tap.native 有问题,稍后修复,可以先使用@click.native替换

@weixisheng
Copy link

还没解决吗

@Otto-J Otto-J added the completed 已完成 label Jan 24, 2024
@Otto-J Otto-J closed this as completed Jan 24, 2024
@Otto-J
Copy link
Member

Otto-J commented Jan 24, 2024

还没解决吗

本帖时间较久,如有问题请开新贴,并补充复现工程

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

4 participants