Skip to content

Commit

Permalink
fix(taro-weapp): didUpdate 后需要更新循环 ref
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen-jj authored and yuche committed Feb 19, 2019
1 parent 01f069c commit 06a5999
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/taro-weapp/src/lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ function doUpdate (component, prevProps, prevState) {
let data = state || {}
if (component._createData) {
// 返回null或undefined则保持不变
data = component._createData(state, props) || data
const runloopRef = !component.__mounted
data = component._createData(state, props, runloopRef) || data
}
let privatePropKeyVal = component.$scope.data[privatePropKeyName] || false

Expand Down Expand Up @@ -117,6 +118,10 @@ function doUpdate (component, prevProps, prevState) {
})
}

if (component['$$hasLoopRef']) {
component._createData(component.state, component.props)
}

if (typeof component.componentDidUpdate === 'function') {
component.componentDidUpdate(prevProps, prevState)
}
Expand Down

0 comments on commit 06a5999

Please sign in to comment.