mirror of
https://gitee.com/antv/g6.git
synced 2024-12-02 19:58:46 +08:00
revert group clear
This commit is contained in:
parent
1295bff9e4
commit
96889ce205
@ -99,7 +99,7 @@
|
||||
"screenshot": "node ./bin/screenshot.js",
|
||||
"start": "npm run dev",
|
||||
"test": "torch --compile --renderer --recursive ./test/unit",
|
||||
"test-live": "torch --compile --interactive --watch --recursive ./test/unit/plugins/tool.textDisplay-spec.js",
|
||||
"test-live": "torch --compile --interactive --watch --recursive ./test/unit/",
|
||||
"watch": "webpack --config webpack-dev.config.js",
|
||||
"win-dev": "node ./bin/win-dev.js"
|
||||
},
|
||||
|
@ -61,6 +61,19 @@ Util.augment(Mixin, {
|
||||
sortBy(callback) {
|
||||
const children = this.get('children');
|
||||
this.set('children', Util.radixSort(children, callback));
|
||||
},
|
||||
/**
|
||||
* clear inner elements
|
||||
* @param {boolean} bool if destroy child
|
||||
* @return {object} this
|
||||
*/
|
||||
clear(bool) {
|
||||
const children = this._cfg.children;
|
||||
for (let i = children.length - 1; i >= 0; i--) {
|
||||
children[i].remove(bool);
|
||||
}
|
||||
this._cfg.children = [];
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user