|
@@ -5,7 +5,7 @@ import {
|
|
|
} from './component'
|
|
} from './component'
|
|
|
import { VNodeFlags, ChildrenFlags } from './flags'
|
|
import { VNodeFlags, ChildrenFlags } from './flags'
|
|
|
import { createComponentClassFromOptions } from './componentUtils'
|
|
import { createComponentClassFromOptions } from './componentUtils'
|
|
|
-import { normalizeClass, normalizeStyle } from './utils'
|
|
|
|
|
|
|
+import { normalizeClass, normalizeStyle, onRE, nativeOnRE } from './utils'
|
|
|
|
|
|
|
|
// Vue core is platform agnostic, so we are not using Element for "DOM" nodes.
|
|
// Vue core is platform agnostic, so we are not using Element for "DOM" nodes.
|
|
|
export interface RenderNode {
|
|
export interface RenderNode {
|
|
@@ -270,7 +270,7 @@ export function cloneVNode(vnode: VNode, extraData?: VNodeData): VNode {
|
|
|
clonedData.class = normalizeClass([clonedData.class, extraData.class])
|
|
clonedData.class = normalizeClass([clonedData.class, extraData.class])
|
|
|
} else if (key === 'style') {
|
|
} else if (key === 'style') {
|
|
|
clonedData.style = normalizeStyle([clonedData.style, extraData.style])
|
|
clonedData.style = normalizeStyle([clonedData.style, extraData.style])
|
|
|
- } else if (key.startsWith('on')) {
|
|
|
|
|
|
|
+ } else if (onRE.test(key) || nativeOnRE.test(key)) {
|
|
|
const existing = clonedData[key]
|
|
const existing = clonedData[key]
|
|
|
clonedData[key] = existing
|
|
clonedData[key] = existing
|
|
|
? [].concat(existing, extraData[key])
|
|
? [].concat(existing, extraData[key])
|