diff --git a/packages/taro-weapp/src/lifecycle.js b/packages/taro-weapp/src/lifecycle.js index 87810b35dc02..0ebfdfa13d35 100644 --- a/packages/taro-weapp/src/lifecycle.js +++ b/packages/taro-weapp/src/lifecycle.js @@ -86,8 +86,9 @@ function doUpdate (component, prevProps, prevState) { // 改变这个私有的props用来触发(observer)子组件的更新 data[privatePropKeyName] = !privatePropKeyVal const dataDiff = diffObjToPath(data, component.$scope.data) + const __mounted = component.__mounted component.$scope.setData(dataDiff, function () { - if (component.__mounted && typeof component.componentDidUpdate === 'function') { + if (__mounted && typeof component.componentDidUpdate === 'function') { component.componentDidUpdate(prevProps, prevState) }