wip: data option compat

This commit is contained in:
Evan You
2021-04-06 09:31:47 -04:00
parent 53b8127a9c
commit d0da0028f2
5 changed files with 53 additions and 10 deletions

View File

@@ -65,6 +65,7 @@ import { warn } from './warning'
import { VNodeChild } from './vnode'
import { callWithAsyncErrorHandling } from './errorHandling'
import { UnionToIntersection } from './helpers/typeUtils'
import { deepMergeData } from './compat/data'
/**
* Interface for declaring custom options.
@@ -904,7 +905,11 @@ function resolveData(
instance.data = reactive(data)
} else {
// existing data: this is a mixin or extends.
extend(instance.data, data)
if (__COMPAT__) {
deepMergeData(instance.data, data)
} else {
extend(instance.data, data)
}
}
}