fix(v-model): should ignore compiled v-model listeners in attr fallthrough
fix #1510
This commit is contained in:
parent
77538ec6d9
commit
6dd59ee301
@ -190,19 +190,20 @@ export function updateProps(
|
|||||||
for (const key in rawCurrentProps) {
|
for (const key in rawCurrentProps) {
|
||||||
if (
|
if (
|
||||||
!rawProps ||
|
!rawProps ||
|
||||||
(
|
|
||||||
// for camelCase
|
// for camelCase
|
||||||
!hasOwn(rawProps, key) &&
|
(!hasOwn(rawProps, key) &&
|
||||||
// it's possible the original props was passed in as kebab-case
|
// it's possible the original props was passed in as kebab-case
|
||||||
// and converted to camelCase (#955)
|
// and converted to camelCase (#955)
|
||||||
((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey)))
|
((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey)))
|
||||||
) {
|
) {
|
||||||
if (options) {
|
if (options) {
|
||||||
if (rawPrevProps && (
|
if (
|
||||||
|
rawPrevProps &&
|
||||||
// for camelCase
|
// for camelCase
|
||||||
rawPrevProps[key] !== undefined ||
|
(rawPrevProps[key] !== undefined ||
|
||||||
// for kebab-case
|
// for kebab-case
|
||||||
rawPrevProps[kebabKey!] !== undefined)) {
|
rawPrevProps[kebabKey!] !== undefined)
|
||||||
|
) {
|
||||||
props[key] = resolvePropValue(
|
props[key] = resolvePropValue(
|
||||||
options,
|
options,
|
||||||
rawProps || EMPTY_OBJ,
|
rawProps || EMPTY_OBJ,
|
||||||
@ -255,7 +256,11 @@ function setFullProps(
|
|||||||
let camelKey
|
let camelKey
|
||||||
if (options && hasOwn(options, (camelKey = camelize(key)))) {
|
if (options && hasOwn(options, (camelKey = camelize(key)))) {
|
||||||
props[camelKey] = value
|
props[camelKey] = value
|
||||||
} else if (!emits || !isEmitListener(emits, key)) {
|
} else if (
|
||||||
|
(!emits || !isEmitListener(emits, key)) &&
|
||||||
|
// ignore v-model listeners
|
||||||
|
!key.startsWith(`onUpdate:`)
|
||||||
|
) {
|
||||||
// Any non-declared (either as a prop or an emitted event) props are put
|
// 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
|
// into a separate `attrs` object for spreading. Make sure to preserve
|
||||||
// original key casing
|
// original key casing
|
||||||
|
Loading…
x
Reference in New Issue
Block a user