From ceccf517936eec4b2488e5aa5a36c708e4a7454a Mon Sep 17 00:00:00 2001 From: pengchongfu Date: Wed, 12 Apr 2017 10:19:09 +0800 Subject: [PATCH] Tree: sort correctly, fix #4006 (#4107) --- packages/tree/src/model/tree-store.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tree/src/model/tree-store.js b/packages/tree/src/model/tree-store.js index 7755defb..981af1f3 100644 --- a/packages/tree/src/model/tree-store.js +++ b/packages/tree/src/model/tree-store.js @@ -189,7 +189,7 @@ export default class TreeStore { _setCheckedKeys(key, leafOnly = false, checkedKeys) { const allNodes = this._getAllNodes(); - allNodes.sort((a, b) => a.level < b.level); + allNodes.sort((a, b) => b.level - a.level); const keys = Object.keys(checkedKeys); allNodes.forEach((node) => {