问题描述
在蚂蚁树中,我们可以通过编程设置selectedKeys
道具。当我这样做时,新节点将突出显示。
但是,当我们通过单击选择一个节点时,会触发onSelect
方法,但是以编程方式设置selectedKeys
时,不会触发该函数,因此我无法获得该节点的详细信息
以编程方式在selectedKeys
数组中设置密钥时,如何获取节点的详细信息?
<Tree
onExpand={onExpand}
expandedKeys={expandedKeys}
autoExpandParent={autoExpandParent}
onSelect={onSelect}
selectedKeys={selectedKeys}
treeData={treeData}
/
setSelectedKeys(key => {
const newKey = [key + '-0'];
return newKey
});
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)