feat:add set environment value api

This commit is contained in:
pengfei.zhou
2021-07-07 17:30:08 +08:00
committed by osborn
parent 0c10b513b9
commit e6595d5c51
18 changed files with 157 additions and 30 deletions

View File

@@ -9,6 +9,7 @@ export declare abstract class Panel {
onDestroy(): void;
onShow(): void;
onHidden(): void;
onEnvChanged(): void;
abstract build(rootView: Group): void;
private __data__?;
private __root__;
@@ -27,6 +28,7 @@ export declare abstract class Panel {
private __onShow__;
private __onHidden__;
private __build__;
private __onEnvChanged__;
private __response__;
private retrospectView;
private nativeRender;

View File

@@ -45,6 +45,10 @@ export class Panel {
onDestroy() { }
onShow() { }
onHidden() { }
onEnvChanged() {
this.__root__.children.length = 0;
this.build(this.__root__);
}
addHeadView(type, v) {
let map = this.headviews.get(type);
if (map) {
@@ -107,6 +111,9 @@ export class Panel {
this.__root__.children.length = 0;
this.build(this.__root__);
}
__onEnvChanged__() {
this.onEnvChanged();
}
__response__(viewIds, callbackId) {
const v = this.retrospectView(viewIds);
if (v === undefined) {
@@ -261,6 +268,12 @@ __decorate([
__metadata("design:paramtypes", [Object]),
__metadata("design:returntype", void 0)
], Panel.prototype, "__build__", null);
__decorate([
NativeCall,
__metadata("design:type", Function),
__metadata("design:paramtypes", []),
__metadata("design:returntype", void 0)
], Panel.prototype, "__onEnvChanged__", null);
__decorate([
NativeCall,
__metadata("design:type", Function),