feat:Add removeChild API for GroupView

This commit is contained in:
pengfei.zhou 2020-05-14 15:07:34 +08:00 committed by osborn
parent 81dfce17fb
commit 3d1b336dac

View File

@ -378,5 +378,15 @@ export abstract class Group extends Superview {
addChild(view: View) {
this.children.push(view)
}
removeChild(view: View) {
const ret = this.children.filter(e => e !== view)
this.children.length = 0
ret.forEach(e => this.addChild(e))
}
removeAllChildren() {
this.children.length = 0
}
}