Skip to content

Commit

Permalink
Revert "refactor: remove unnecessary checks (vuejs#7875)"
Browse files Browse the repository at this point in the history
This reverts commit 43551b4.
  • Loading branch information
yyx990803 authored and aJean committed Aug 19, 2020
1 parent cd8177c commit 34f37df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/instance/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 34f37df

Please sign in to comment.