fix(runtime-dom): fix patching for attributes starting with on

fix #949

BREAKING CHANGE: Only props starting with `on` followed by an uppercase
letter or a non-letter character are considered event listeners.
This commit is contained in:
Evan You
2020-04-10 11:57:07 -04:00
parent 55566e8f52
commit 6eb3399311
8 changed files with 72 additions and 58 deletions

View File

@@ -66,12 +66,12 @@ export function emit(
}
}
let handler = props[`on${event}`] || props[`on${capitalize(event)}`]
let handler = props[`on${capitalize(event)}`]
// for v-model update:xxx events, also trigger kebab-case equivalent
// for props passed via kebab-case
if (!handler && event.indexOf('update:') === 0) {
event = hyphenate(event)
handler = props[`on${event}`] || props[`on${capitalize(event)}`]
handler = props[`on${capitalize(event)}`]
}
if (handler) {
callWithAsyncErrorHandling(