diff --git a/doric-js/src/ui/view.ts b/doric-js/src/ui/view.ts index d307289c..82352749 100644 --- a/doric-js/src/ui/view.ts +++ b/doric-js/src/ui/view.ts @@ -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 + } }