Closed
Description
What problem does this feature solve?
I am writing VCA called useEventListener,which can be used to addEventListener with native HTML element and $on with Vue Component(2.0 @vue/composition-api)。while in Vue 3.0, there are no $on any more and cannot add new eventHandler after component mounted(e.g. with component ref)
What does the proposed API look like?
<el-button @click="handleClick">click</el-button>,then we can use handleClick
but with
<el-button ref="buttonRef">click me</el-button>
useEventListener('click', evt => alert(1), false, buttonRef) // cannot get buttonRef.$on or set buttonRef.onClick(onXXX) in 3.0
readonly proxy can set onXXX instead of reject with warning message
Metadata
Metadata
Assignees
Labels
No labels