Browse Source

Revert "refactor: remove unnecessary checks (#7875)"

This reverts commit 43551b4fb6.
dev
Evan You 7 years ago
parent
commit
903be9b91f
  1. 5
      src/core/instance/state.js

5
src/core/instance/state.js

@ -111,8 +111,9 @@ function initProps (vm: Component, propsOptions: Object) {
function initData (vm: Component) {
let data = vm.$options.data
// $options.data is guaranteed to be a function after merge
data = vm._data = getData(data, vm)
data = vm._data = typeof data === 'function'
? getData(data, vm)
: data || {}
if (!isPlainObject(data)) {
data = {}
process.env.NODE_ENV !== 'production' && warn(

Loading…
Cancel
Save