fix(custom-element): fix event listeners with capital letter event names on custom elements

close https://github.com/vuejs/docs/issues/1708
close https://github.com/vuejs/docs/pull/1890
This commit is contained in:
Evan You
2022-08-30 14:07:35 +08:00
parent 9f8f07ed38
commit 0739f8909a
7 changed files with 99 additions and 12 deletions

View File

@@ -101,7 +101,8 @@ function parseName(name: string): [string, EventListenerOptions | undefined] {
;(options as any)[m[0].toLowerCase()] = true
}
}
return [hyphenate(name.slice(2)), options]
const event = name[2] === ':' ? name.slice(3) : hyphenate(name.slice(2))
return [event, options]
}
function createInvoker(