feat:fix view has no superview

This commit is contained in:
pengfei.zhou
2019-11-26 11:33:08 +08:00
parent 1f0a1a5e0a
commit a5b07949ba
2 changed files with 21 additions and 1 deletions

View File

@@ -316,6 +316,7 @@ export abstract class Superview extends View {
toModel() {
const subviews = []
for (let v of this.allSubviews()) {
v.superview = this
if (v.isDirty()) {
subviews.push(v.toModel())
}
@@ -341,7 +342,6 @@ export abstract class Group extends Superview {
}
addChild(view: View) {
view.superview = this
this.children.push(view)
}
}