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

@@ -24,7 +24,8 @@ export const NOOP = () => {}
*/
export const NO = () => false
export const isOn = (key: string) => key[0] === 'o' && key[1] === 'n'
const onRE = /^on[^a-z]/
export const isOn = (key: string) => onRE.test(key)
export const extend = <T extends object, U extends object>(
a: T,