Commit 76d9e76a authored by ibuler's avatar ibuler

[Update] 修复搜索的问题

parent ed215200
...@@ -289,12 +289,12 @@ export class ElementAssetTreeComponent implements OnInit, OnDestroy { ...@@ -289,12 +289,12 @@ export class ElementAssetTreeComponent implements OnInit, OnDestroy {
if (!this.assetsTree) { if (!this.assetsTree) {
return; return;
} }
const searchNode = this.assetsTree.getNodesByFilter((node) => node.id === 'search');
if (searchNode) {
this.assetsTree.removeChildNodes(searchNode[0]);
this.assetsTree.removeNode(searchNode[0]);
}
if (!keyword) { if (!keyword) {
const searchNode = this.assetsTree.getNodesByFilter((node) => node.id === 'search');
if (searchNode) {
this.assetsTree.removeChildNodes(searchNode[0]);
this.assetsTree.removeNode(searchNode[0]);
}
const treeNodes = this.assetsTree.getNodes(); const treeNodes = this.assetsTree.getNodes();
if (treeNodes.length !== 0) { if (treeNodes.length !== 0) {
this.assetsTree.showNode(treeNodes[0]); this.assetsTree.showNode(treeNodes[0]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment