Skip to content

Commit

Permalink
支持 onUnload 生命周期 (#11641)
Browse files Browse the repository at this point in the history
* 支持 onUnload 生命周期

* 支持 onUnload 生命周期

* 支持 onUnload 生命周期

Co-authored-by: bianyl <bianyl@trip.com>
Co-authored-by: chenjiajian <798095202@qq.com>
  • Loading branch information
3 people authored Apr 13, 2022
1 parent 0a96e1a commit 07b15b8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/taro-runtime/src/dsl/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ export function createPageConfig (component: any, pageName?: string, data?: Reco
},
[ONUNLOAD] () {
const $taroPath = this.$taroPath
// 触发onUnload生命周期
safeExecute($taroPath, ONUNLOAD)
unmounting = true
Current.app!.unmount!($taroPath, () => {
unmounting = false
Expand Down

0 comments on commit 07b15b8

Please sign in to comment.