We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 931aaea commit d9cde49Copy full SHA for d9cde49
src/core/util/options.js
@@ -67,14 +67,15 @@ function mergeData (to: Object, from: ?Object): Object {
67
strats.data = function (
68
parentVal: any,
69
childVal: any,
70
- vm?: Component
+ vm?: Component,
71
+ option: String
72
): ?Function {
73
if (!vm) {
74
// in a Vue.extend merge, both should be functions
75
if (!childVal) {
76
return parentVal
77
}
- if (typeof childVal !== 'function') {
78
+ if (option === 'data' && typeof childVal !== 'function') {
79
process.env.NODE_ENV !== 'production' && warn(
80
'The "data" option should be a function ' +
81
'that returns a per-instance value in component ' +
0 commit comments