We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7b38739 commit 43551b4Copy full SHA for 43551b4
src/core/instance/state.js
@@ -111,9 +111,8 @@ function initProps (vm: Component, propsOptions: Object) {
111
112
function initData (vm: Component) {
113
let data = vm.$options.data
114
- data = vm._data = typeof data === 'function'
115
- ? getData(data, vm)
116
- : data || {}
+ // $options.data is guaranteed to be a function after merge
+ data = vm._data = getData(data, vm)
117
if (!isPlainObject(data)) {
118
data = {}
119
process.env.NODE_ENV !== 'production' && warn(
0 commit comments