diff --git a/src/core/instance/state.js b/src/core/instance/state.js index 7d349ebe..859e93d3 100644 --- a/src/core/instance/state.js +++ b/src/core/instance/state.js @@ -63,7 +63,7 @@ function initData (vm: Component) { } // observe data observe(data) - data.__ob__.vmCount++ + data.__ob__ && data.__ob__.vmCount++ } const computedSharedDefinition = { @@ -206,8 +206,8 @@ function setData (vm: Component, newData: Object) { proxy(vm, key) } } - oldData.__ob__.vmCount-- + oldData.__ob__ && oldData.__ob__.vmCount-- observe(newData) - newData.__ob__.vmCount++ + newData.__ob__ && newData.__ob__.vmCount++ vm.$forceUpdate() }