Skip to content

Commit ee0e8b5

Browse files
HcySunYangyyx990803
authored andcommitted
refactor: tweak data merge strategy (#6833)
* tweak: The value of this is always undefined * parentVal and childVal must have a presence, otherwise the strats.data policy function will not be executed
1 parent 98ea0a3 commit ee0e8b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/util/options.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export function mergeDataOrFn (
8989
typeof parentVal === 'function' ? parentVal.call(this) : parentVal
9090
)
9191
}
92-
} else if (parentVal || childVal) {
92+
} else {
9393
return function mergedInstanceDataFn () {
9494
// instance merge
9595
const instanceData = typeof childVal === 'function'
@@ -123,7 +123,7 @@ strats.data = function (
123123

124124
return parentVal
125125
}
126-
return mergeDataOrFn.call(this, parentVal, childVal)
126+
return mergeDataOrFn(parentVal, childVal)
127127
}
128128

129129
return mergeDataOrFn(parentVal, childVal, vm)

0 commit comments

Comments
 (0)