fix(runtime-core): pass instance proxy as data() argument (#828)

Match current behaviour of vue 2
This commit is contained in:
sqal 2020-03-16 15:28:17 +01:00 committed by GitHub
parent f107abf247
commit d9dd1d8a0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -286,7 +286,7 @@ export function applyOptions(
`Plain object usage is no longer supported.` `Plain object usage is no longer supported.`
) )
} }
const data = dataOptions.call(ctx) const data = dataOptions.call(ctx, ctx)
if (!isObject(data)) { if (!isObject(data)) {
__DEV__ && warn(`data() should return an object.`) __DEV__ && warn(`data() should return an object.`)
} else if (instance.data === EMPTY_OBJ) { } else if (instance.data === EMPTY_OBJ) {