diff --git a/packages/runtime-core/src/compat/data.ts b/packages/runtime-core/src/compat/data.ts index 121c0f9a688..883c64fbbaa 100644 --- a/packages/runtime-core/src/compat/data.ts +++ b/packages/runtime-core/src/compat/data.ts @@ -7,18 +7,19 @@ 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 } } + return to } export function mergeDataOption(to: any, from: any) {