opt: superview's subviews must be marked also

This commit is contained in:
pengfei.zhou
2021-06-25 16:36:31 +08:00
committed by osborn
parent 92b106d11f
commit c574f87b94
8 changed files with 71 additions and 6 deletions

View File

@@ -414,6 +414,14 @@ export abstract class Superview extends View {
if (key.startsWith("__prop__")) {
v.onPropertyChanged(key, undefined, Reflect.get(v, key))
}
if (v instanceof Superview) {
for (const subview of v.allSubviews()) {
subview.superview = {} as Superview
}
}
if (v instanceof Group) {
v.dirtyProps.children = v.children.map(e => e.viewId)
}
}
}
v.superview = this

View File

@@ -382,7 +382,6 @@ export abstract class View implements Modeling {
})
}
}
export abstract class Superview extends View {
subviewById(id: string): View | undefined {
for (let v of this.allSubviews()) {
@@ -440,6 +439,14 @@ export abstract class Superview extends View {
if (Reflect.getMetadata(key, v) === PROP_CONSIST || Reflect.getMetadata(key, v) === PROP_INCONSIST) {
v.onPropertyChanged(key, undefined, Reflect.get(v, key))
}
if (v instanceof Superview) {
for (const subview of v.allSubviews()) {
subview.superview = {} as Superview
}
}
if (v instanceof Group) {
v.dirtyProps.children = v.children.map(e => e.viewId)
}
}
}
v.superview = this