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

@@ -3,7 +3,7 @@ import { patchStyle } from './modules/style'
import { patchAttr } from './modules/attrs'
import { patchDOMProp } from './modules/props'
import { patchEvent } from './modules/events'
import { isOn, isString, isFunction } from '@vue/shared'
import { isOn, isString, isFunction, isModelListener } from '@vue/shared'
import { RendererOptions } from '@vue/runtime-core'
const nativeOnRE = /^on[a-z]/
@@ -35,7 +35,7 @@ export const patchProp: DOMRendererOptions['patchProp'] = (
default:
if (isOn(key)) {
// ignore v-model listeners
if (!key.startsWith('onUpdate:')) {
if (!isModelListener(key)) {
patchEvent(el, key, prevValue, nextValue, parentComponent)
}
} else if (shouldSetAsProp(el, key, nextValue, isSVG)) {