Skip to content

在自定义指令中,怎么覆盖添加在组件上的事件监听方法? #8145

Discussion options

You must be logged in to vote

demo

先通过

el.removeEventListener('click', vnode.el._vei.onClick);

移除原有的点击事件,之后再添加新的click监听

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@chenxch
Comment options

@blinkJun
Comment options

@Justineo
Comment options

@chenxch
Comment options

@jiaxin-MXX
Comment options

Answer selected by blinkJun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants