@@ -209,28 +209,36 @@ export function parseJSXElement(
209209 continue ;
210210 }
211211 let handler : EventHandler [ ] | null = null ;
212+ let eventPath = exprPath ;
212213 // Assert: exprPath.isReferencedIdentifier()
213214 if ( exprPath . isIdentifier ( ) ) {
214215 const bindingId = exprPath . scope . getBindingIdentifier (
215216 exprPath . node . name
216217 ) ;
217218 if ( bindingId ) {
218219 const binding = options . component ?. bindingMap . get ( bindingId ) ;
219- if ( binding && binding . kind === "eventHandler" ) {
220- handler = [
221- {
222- action : "dispatch_event" ,
223- payload : {
224- type : convertJsxEventAttr ( binding . id . name ) ,
225- detail : "<% EVENT.detail %>" ,
226- } ,
227- } ,
228- ] ;
220+ if ( binding ) {
221+ switch ( binding . kind ) {
222+ case "eventHandlerParam" :
223+ handler = [
224+ {
225+ action : "dispatch_event" ,
226+ payload : {
227+ type : convertJsxEventAttr ( binding . id . name ) ,
228+ detail : "<% EVENT.detail %>" ,
229+ } ,
230+ } ,
231+ ] ;
232+ break ;
233+ case "eventCallback" :
234+ eventPath = binding . callback ! ;
235+ break ;
236+ }
229237 }
230238 }
231239 }
232240 if ( ! handler ) {
233- handler = parseEvent ( exprPath , state , app , options ) ;
241+ handler = parseEvent ( eventPath , state , app , options ) ;
234242 }
235243 if ( handler ) {
236244 if ( attrName === "onMount" || attrName === "onUnmount" ) {
0 commit comments