fix(runtime-core): fix v-on object kebab-case event emit matching
fix #3527
This commit is contained in:
@@ -114,14 +114,15 @@ export function emit(
|
||||
}
|
||||
}
|
||||
|
||||
// convert handler name to camelCase. See issue #2249
|
||||
let handlerName = toHandlerKey(camelize(event))
|
||||
let handler = props[handlerName]
|
||||
let handlerName
|
||||
let handler =
|
||||
props[(handlerName = toHandlerKey(event))] ||
|
||||
// also try camelCase event handler (#2249)
|
||||
props[(handlerName = toHandlerKey(camelize(event)))]
|
||||
// for v-model update:xxx events, also trigger kebab-case equivalent
|
||||
// for props passed via kebab-case
|
||||
if (!handler && isModelListener) {
|
||||
handlerName = toHandlerKey(hyphenate(event))
|
||||
handler = props[handlerName]
|
||||
handler = props[(handlerName = toHandlerKey(hyphenate(event)))]
|
||||
}
|
||||
|
||||
if (handler) {
|
||||
|
||||
Reference in New Issue
Block a user