Skip to content

Commit

Permalink
fix(runtime-core): should allow v-model listeners to fallthrough, but…
Browse files Browse the repository at this point in the history
… ignore for warning

fix #1543
  • Loading branch information
yyx990803 committed Jul 8, 2020
1 parent 1e90605 commit 903e8f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 1 addition & 5 deletions packages/runtime-core/src/componentProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,7 @@ function setFullProps(
let camelKey
if (options && hasOwn(options, (camelKey = camelize(key)))) {
props[camelKey] = value
} else if (
(!emits || !isEmitListener(emits, key)) &&
// ignore v-model listeners
!key.startsWith(`onUpdate:`)
) {
} else if (!emits || !isEmitListener(emits, key)) {
// Any non-declared (either as a prop or an emitted event) props are put
// into a separate `attrs` object for spreading. Make sure to preserve
// original key casing
Expand Down
8 changes: 6 additions & 2 deletions packages/runtime-core/src/componentRenderUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,12 @@ export function renderComponentRoot(
for (let i = 0, l = allAttrs.length; i < l; i++) {
const key = allAttrs[i]
if (isOn(key)) {
// remove `on`, lowercase first letter to reflect event casing accurately
eventAttrs.push(key[2].toLowerCase() + key.slice(3))
// ignore v-model handlers when they fail to fallthrough
if (!key.startsWith('onUpdate:')) {
// remove `on`, lowercase first letter to reflect event casing
// accurately
eventAttrs.push(key[2].toLowerCase() + key.slice(3))
}
} else {
extraAttrs.push(key)
}
Expand Down

0 comments on commit 903e8f6

Please sign in to comment.