feat:adjust the inject timing of panel's initData

This commit is contained in:
pengfei.zhou
2020-03-19 13:35:04 +08:00
committed by osborn
parent 08454d53ea
commit 2b62e8bd3b
18 changed files with 87 additions and 65 deletions

View File

@@ -88,14 +88,10 @@ export abstract class Panel {
}
@NativeCall
private __init__(frame: Frame, data?: string) {
private __init__(data?: string) {
if (data) {
this.__data__ = JSON.parse(data)
}
this.__root__.width = frame.width
this.__root__.height = frame.height
this.__root__.children.length = 0
this.build(this.__root__)
}
@NativeCall
@@ -119,7 +115,10 @@ export abstract class Panel {
}
@NativeCall
private __build__() {
private __build__(frame: Frame) {
this.__root__.width = frame.width
this.__root__.height = frame.height
this.__root__.children.length = 0
this.build(this.__root__)
}

View File

@@ -39,7 +39,7 @@ export interface IVLayout extends IView {
gravity?: Gravity
}
export class VLayout extends LinearLayout implements VLayout {
export class VLayout extends LinearLayout implements IVLayout {
}