fix: checkStrictly为true时,兼容renderTreeNodes方法的循环

This commit is contained in:
gx 2021-01-13 14:20:11 +08:00
parent 3237aa7809
commit 957148e169
1 changed files with 6 additions and 1 deletions

View File

@ -389,7 +389,12 @@ onExpand(treeNode,keyType) {
}
this.treeNodesStates[treeNode.props.pos].checked = checked;
newSt.checkedNodes = [];
loopAllChildren(this.props.children, (item, ind, pos, keyOrPos) => {
let childs = this.props.children
const { renderTreeNodes, treeData } = this.props
if (renderTreeNodes && treeData) {
childs = renderTreeNodes(treeData)
}
loopAllChildren(childs, (item, ind, pos, keyOrPos) => {
if (checkedKeys.indexOf(keyOrPos) !== -1) {
newSt.checkedNodes.push(item);
rsCheckedKeys.push(keyOrPos);