|
|
@@ -593,4 +593,13 @@ export class Tree {
|
|
|
this.updateValue(updateData);
|
|
|
this.resortDataByID([orgParentID, newParentID]);
|
|
|
}
|
|
|
+
|
|
|
+ // 清除所有节点(不变更data引用)
|
|
|
+ clear(): void {
|
|
|
+ this.rawData.splice(0, this.rawData.length);
|
|
|
+ this.data.splice(0, this.data.length);
|
|
|
+ this.parentMap = {};
|
|
|
+ this.IDMap = {};
|
|
|
+ this.ctxMap = {};
|
|
|
+ }
|
|
|
}
|