From a53ead9d899dc22eea2c188e7d643ffd1bf7ce18 Mon Sep 17 00:00:00 2001 From: Sergej Sintschilin Date: Fri, 28 May 2021 17:14:04 +0200 Subject: [PATCH] return merged data from mergedDataFn --- packages/runtime-core/src/compat/data.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/runtime-core/src/compat/data.ts b/packages/runtime-core/src/compat/data.ts index 121c0f9a688..06c7d8f7940 100644 --- a/packages/runtime-core/src/compat/data.ts +++ b/packages/runtime-core/src/compat/data.ts @@ -29,10 +29,13 @@ export function mergeDataOption(to: any, from: any) { return from } return function mergedDataFn(this: ComponentPublicInstance) { - return deepMergeData( - isFunction(to) ? to.call(this, this) : to, - isFunction(from) ? from.call(this, this) : from, - this.$ - ) + if (isFunction(to)) { + to = to.call(this, this) + } + if (isFunction(from)) { + from = from.call(this, this) + } + deepMergeData(to, from, this.$) + return to } }