Skip to content

Commit

Permalink
fix(alipay): 函数 Page 组件没有触发effect cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
AEPKILL authored and Chen-jj committed Nov 26, 2019
1 parent 17e0271 commit deaebb7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/taro-alipay/src/create-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,13 @@ function createComponent (ComponentClass, isPage) {
componentTrigger(this.$component, 'componentWillUnmount')
const component = this.$component
const events = component.$$renderPropsEvents

component.hooks.forEach((hook) => {
if (isFunction(hook.cleanup)) {
hook.cleanup()
}
})

if (isArray(events)) {
events.forEach(e => eventCenter.off(e))
}
Expand Down

0 comments on commit deaebb7

Please sign in to comment.