Skip to content

Commit

Permalink
fix(with-weapp): 修复 taroize 转换后 setData 方法无回调的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Aug 27, 2019
1 parent bcde899 commit 58f8038
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/taro-with-weapp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ export default function withWeapp (componentType: string, weappConf?: Object) {
}
}

setData = (obj: S) => {
setData = (obj: S, callback?: () => any) => {
const state = Object.assign({}, this.state)
Object.keys(obj).forEach(key => {
safeSet(state, key, obj[key])
})
Object.assign(this.state, state)
this.setState(state)
this.setState(state, callback)
}

triggerEvent = (eventName: string, ...args: any[]) => {
Expand Down

0 comments on commit 58f8038

Please sign in to comment.