From ed139923f4196cd4c455f67a7e78fc9cd1c6baab Mon Sep 17 00:00:00 2001 From: daiwei Date: Mon, 31 May 2021 09:21:46 +0800 Subject: [PATCH 1/2] fix(runtime-core): deepMergeData corrently --- packages/runtime-core/src/compat/data.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/runtime-core/src/compat/data.ts b/packages/runtime-core/src/compat/data.ts index 121c0f9a688..fa8b10858c5 100644 --- a/packages/runtime-core/src/compat/data.ts +++ b/packages/runtime-core/src/compat/data.ts @@ -19,6 +19,7 @@ export function deepMergeData( to[key] = fromVal } } + return to } export function mergeDataOption(to: any, from: any) { From a262e776a8759ff235f8fdf625ee1aa3eb8d0358 Mon Sep 17 00:00:00 2001 From: daiwei Date: Mon, 31 May 2021 09:29:29 +0800 Subject: [PATCH 2/2] fix(runtime-core): deepMergeData corrently --- packages/runtime-core/src/compat/data.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/runtime-core/src/compat/data.ts b/packages/runtime-core/src/compat/data.ts index fa8b10858c5..883c64fbbaa 100644 --- a/packages/runtime-core/src/compat/data.ts +++ b/packages/runtime-core/src/compat/data.ts @@ -7,14 +7,14 @@ export function deepMergeData( to: any, from: any, instance: ComponentInternalInstance -) { +): any { for (const key in from) { const toVal = to[key] const fromVal = from[key] if (key in to && isPlainObject(toVal) && isPlainObject(fromVal)) { __DEV__ && warnDeprecation(DeprecationTypes.OPTIONS_DATA_MERGE, instance, key) - deepMergeData(toVal, fromVal, instance) + return deepMergeData(toVal, fromVal, instance) } else { to[key] = fromVal }