瀏覽代碼

Tree: when tree nodes filtered, don't expand node in lazy mode (#11395)

hetech 7 年之前
父節點
當前提交
a230e4a0ff
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      packages/tree/src/model/tree-store.js

+ 2 - 1
packages/tree/src/model/tree-store.js

@@ -32,6 +32,7 @@ export default class TreeStore {
 
   filter(value) {
     const filterNodeMethod = this.filterNodeMethod;
+    const lazy = this.lazy;
     const traverse = function(node) {
       const childNodes = node.root ? node.root.childNodes : node.childNodes;
 
@@ -56,7 +57,7 @@ export default class TreeStore {
       }
       if (!value) return;
 
-      if (node.visible && !node.isLeaf) node.expand();
+      if (node.visible && !node.isLeaf && !lazy) node.expand();
     };
 
     traverse(this);