add lifecycle

This commit is contained in:
pengfei.zhou
2019-08-03 11:51:59 +08:00
parent 9a13cdb3ad
commit 4d8e11b660
3 changed files with 22 additions and 4 deletions

View File

@@ -18,7 +18,7 @@ type Frame = { width: number, height: number }
export abstract class Panel {
context?: any
onCreate() { }
onDestory() { }
onDestroy() { }
onShow() { }
onHidden() { }
@@ -30,6 +30,7 @@ export abstract class Panel {
getRootView() {
return this.__root__
}
getInitData() {
return this.__data__
}
@@ -48,8 +49,8 @@ export abstract class Panel {
}
@NativeCall
private __onDestory__() {
this.onDestory()
private __onDestroy__() {
this.onDestroy()
}
@NativeCall