fix(runtime-core): should remove no longer present camelCase props (#1413)

fix #1412
This commit is contained in:
underfin
2020-06-26 21:16:06 +08:00
committed by GitHub
parent 056cac9185
commit 1c4e1b6792
2 changed files with 14 additions and 5 deletions

View File

@@ -190,13 +190,19 @@ export function updateProps(
for (const key in rawCurrentProps) {
if (
!rawProps ||
(!hasOwn(rawProps, key) &&
(
// for camelCase
!hasOwn(rawProps, key) &&
// it's possible the original props was passed in as kebab-case
// and converted to camelCase (#955)
((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey)))
) {
if (options) {
if (rawPrevProps && rawPrevProps[kebabKey!] !== undefined) {
if (rawPrevProps && (
// for camelCase
rawPrevProps[key] !== undefined ||
// for kebab-case
rawPrevProps[kebabKey!] !== undefined)) {
props[key] = resolvePropValue(
options,
rawProps || EMPTY_OBJ,