Skip to content

Commit

Permalink
fix(taro-weapp): 修正组件 onShareAppMessage 等生命周期方法调用
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Jul 31, 2018
1 parent 60f2f69 commit fdac132
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/taro-weapp/src/create-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@ function createComponent (ComponentClass, isPage) {
}
pageExtraFns.forEach(fn => {
weappComponentConf[fn] = function () {
componentTrigger(this.$component, fn, arguments)
const component = this.$component
if (component[fn] && typeof component[fn] === 'function') {
return component[fn].call(component, ...arguments)
}
}
})
}
Expand Down

0 comments on commit fdac132

Please sign in to comment.