js: add generated child remove api
This commit is contained in:
parent
750215917b
commit
4d80048d60
@ -444,6 +444,14 @@ class Group extends Superview {
|
|||||||
addChild(view) {
|
addChild(view) {
|
||||||
this.children.push(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;
|
const SPECIFIED = 1;
|
||||||
|
@ -1903,6 +1903,14 @@ class Group extends Superview {
|
|||||||
addChild(view) {
|
addChild(view) {
|
||||||
this.children.push(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;
|
const SPECIFIED = 1;
|
||||||
|
2
doric-js/index.d.ts
vendored
2
doric-js/index.d.ts
vendored
@ -242,6 +242,8 @@ declare module 'doric/lib/src/ui/view' {
|
|||||||
readonly children: View[];
|
readonly children: View[];
|
||||||
allSubviews(): View[];
|
allSubviews(): View[];
|
||||||
addChild(view: View): void;
|
addChild(view: View): void;
|
||||||
|
removeChild(view: View): void;
|
||||||
|
removeAllChildren(): void;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
doric-js/lib/src/ui/view.d.ts
vendored
2
doric-js/lib/src/ui/view.d.ts
vendored
@ -123,4 +123,6 @@ export declare abstract class Group extends Superview {
|
|||||||
readonly children: View[];
|
readonly children: View[];
|
||||||
allSubviews(): View[];
|
allSubviews(): View[];
|
||||||
addChild(view: View): void;
|
addChild(view: View): void;
|
||||||
|
removeChild(view: View): void;
|
||||||
|
removeAllChildren(): void;
|
||||||
}
|
}
|
||||||
|
@ -329,4 +329,12 @@ export class Group extends Superview {
|
|||||||
addChild(view) {
|
addChild(view) {
|
||||||
this.children.push(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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
8
doric-web/dist/index.js
vendored
8
doric-web/dist/index.js
vendored
@ -1961,6 +1961,14 @@ class Group extends Superview {
|
|||||||
addChild(view) {
|
addChild(view) {
|
||||||
this.children.push(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;
|
const SPECIFIED = 1;
|
||||||
|
2
doric-web/dist/index.js.map
vendored
2
doric-web/dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user