fix(v-model): v-model listeners should not fallthrough to plain element root

fix #1643
This commit is contained in:
Evan You
2020-07-21 14:17:48 -04:00
parent 304830a764
commit c852bf18d7
4 changed files with 71 additions and 53 deletions

View File

@@ -9,7 +9,8 @@ import {
normalizeStyle,
PatchFlags,
ShapeFlags,
SlotFlags
SlotFlags,
isOn
} from '@vue/shared'
import {
ComponentInternalInstance,
@@ -583,8 +584,6 @@ export function normalizeChildren(vnode: VNode, children: unknown) {
vnode.shapeFlag |= type
}
const handlersRE = /^on|^vnode/
export function mergeProps(...args: (Data & VNodeProps)[]) {
const ret = extend({}, args[0])
for (let i = 1; i < args.length; i++) {
@@ -596,8 +595,7 @@ export function mergeProps(...args: (Data & VNodeProps)[]) {
}
} else if (key === 'style') {
ret.style = normalizeStyle([ret.style, toMerge.style])
} else if (handlersRE.test(key)) {
// on*, vnode*
} else if (isOn(key)) {
const existing = ret[key]
const incoming = toMerge[key]
if (existing !== incoming) {