opt:when subview is reused, transfer its property totally

This commit is contained in:
pengfei.zhou
2021-06-24 15:10:00 +08:00
committed by osborn
parent 07a958c3bd
commit 92b106d11f
8 changed files with 57 additions and 1 deletions

View File

@@ -368,6 +368,14 @@ export class Superview extends View {
const subviews = [];
for (let v of this.allSubviews()) {
if (v != undefined) {
if (v.superview && v.superview !== this) {
//It had been added to another view, need to be marked totally
for (let key in v) {
if (Reflect.getMetadata(key, v) === PROP_CONSIST || Reflect.getMetadata(key, v) === PROP_INCONSIST) {
v.onPropertyChanged(key, undefined, Reflect.get(v, key));
}
}
}
v.superview = this;
if (v.isDirty()) {
subviews.push(v.toModel());