// separate `attrs` object, which can then be merged onto child component
// root. in addition, if the component has explicitly declared props, then
// any non-matching props are extracted into `attrs` as well.
- let isNativeOn
if (
key === 'class' ||
key === 'style' ||
vnodeHookRE.test(key) ||
- (isNativeOn = nativeOnRE.test(key)) ||
+ nativeOnRE.test(key) ||
(hasDeclaredProps && !options.hasOwnProperty(key))
) {
- const newKey = isNativeOn ? 'on' + key.slice(8) : key
- ;(attrs || (attrs = {}))[newKey] = rawData[key]
+ ;(attrs || (attrs = {}))[key] = rawData[key]
} else {
props[key] = rawData[key]
}
import { patchDOMProp } from './modules/props'
import { patchEvent } from './modules/events'
-export const onRE = /^on/
+export const onRE = /^on|^nativeOn/
const domPropsRE = /^domProps/
export function patchData(
break
default:
if (onRE.test(key)) {
- patchEvent(el, key.toLowerCase().slice(2), prevValue, nextValue)
+ patchEvent(
+ el,
+ key.replace(onRE, '').toLowerCase(),
+ prevValue,
+ nextValue
+ )
} else if (domPropsRE.test(key)) {
patchDOMProp(
el,