js: add generated child remove api
This commit is contained in:
@@ -444,6 +444,14 @@ class Group extends Superview {
|
||||
addChild(view) {
|
||||
this.children.push(view);
|
||||
}
|
||||
removeChild(view) {
|
||||
const ret = this.children.filter(e => e !== view);
|
||||
this.children.length = 0;
|
||||
ret.forEach(e => this.addChild(e));
|
||||
}
|
||||
removeAllChildren() {
|
||||
this.children.length = 0;
|
||||
}
|
||||
}
|
||||
|
||||
const SPECIFIED = 1;
|
||||
|
@@ -1903,6 +1903,14 @@ class Group extends Superview {
|
||||
addChild(view) {
|
||||
this.children.push(view);
|
||||
}
|
||||
removeChild(view) {
|
||||
const ret = this.children.filter(e => e !== view);
|
||||
this.children.length = 0;
|
||||
ret.forEach(e => this.addChild(e));
|
||||
}
|
||||
removeAllChildren() {
|
||||
this.children.length = 0;
|
||||
}
|
||||
}
|
||||
|
||||
const SPECIFIED = 1;
|
||||
|
Reference in New Issue
Block a user