Skip to content

Commit 903e8f6

Browse files
committed
fix(runtime-core): should allow v-model listeners to fallthrough, but ignore for warning
fix #1543
1 parent 1e90605 commit 903e8f6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/runtime-core/src/componentProps.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,7 @@ function setFullProps(
256256
let camelKey
257257
if (options && hasOwn(options, (camelKey = camelize(key)))) {
258258
props[camelKey] = value
259-
} else if (
260-
(!emits || !isEmitListener(emits, key)) &&
261-
// ignore v-model listeners
262-
!key.startsWith(`onUpdate:`)
263-
) {
259+
} else if (!emits || !isEmitListener(emits, key)) {
264260
// Any non-declared (either as a prop or an emitted event) props are put
265261
// into a separate `attrs` object for spreading. Make sure to preserve
266262
// original key casing

packages/runtime-core/src/componentRenderUtils.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,12 @@ export function renderComponentRoot(
121121
for (let i = 0, l = allAttrs.length; i < l; i++) {
122122
const key = allAttrs[i]
123123
if (isOn(key)) {
124-
// remove `on`, lowercase first letter to reflect event casing accurately
125-
eventAttrs.push(key[2].toLowerCase() + key.slice(3))
124+
// ignore v-model handlers when they fail to fallthrough
125+
if (!key.startsWith('onUpdate:')) {
126+
// remove `on`, lowercase first letter to reflect event casing
127+
// accurately
128+
eventAttrs.push(key[2].toLowerCase() + key.slice(3))
129+
}
126130
} else {
127131
extraAttrs.push(key)
128132
}

0 commit comments

Comments
 (0)