diff --git a/changelog.md b/changelog.md index 4865f27b5..f1f088975 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,7 @@ # 更新日志 +2.0(2020-09) +- BI.Tree.traversal方法迭代函数增加父节点参数 + 2.0(2020-08) - bi.sign_editor支持显示值居左/居中/居右显示 - bi.iframe新增EVENT_LOADED事件 diff --git a/src/core/utils/tree.js b/src/core/utils/tree.js index 43448967d..44c258461 100644 --- a/src/core/utils/tree.js +++ b/src/core/utils/tree.js @@ -500,17 +500,17 @@ }, - traversal: function (array, callback) { + traversal: function (array, callback, pNode) { if (BI.isNull(array)) { return; } var self = this; BI.some(array, function (i, item) { - if (callback(i, item) === false) { + if (callback(i, item, pNode) === false) { return true; } - self.traversal(item.children, callback); + self.traversal(item.children, callback, item); }); } }); -})(); \ No newline at end of file +})();