fix: 懒加载场景中treeNode为undefined取不到key

This commit is contained in:
izbz wh 2020-10-21 15:18:00 +08:00
parent 8496f05900
commit 2aabc5090d
1 changed files with 1 additions and 1 deletions

View File

@ -748,7 +748,7 @@ onExpand(treeNode,keyType) {
let tabIndexKey = selectedKeys[0]
let isExist = false;
const treeNode = children&&children.length && children[0];
let eventKey = treeNode&&treeNode.props.eventKey || treeNode.key;
let eventKey = treeNode && (treeNode.props.eventKey || treeNode.key);
if((this.selectKeyDomExist && tabIndexKey) || !tabIndexKey){
isExist = true;
const queryInfo = `a[pos="${this.selectKeyDomPos}"]`;