资源分类组件label获取优化

This commit is contained in:
禺狨 2023-03-22 09:38:52 +08:00
parent b4ea8248e0
commit 55f346accf

View File

@ -70,20 +70,14 @@ export const TreeCategory = (props: PropInterface) => {
const onSelect = (selectedKeys: any, info: any) => { const onSelect = (selectedKeys: any, info: any) => {
let label = "全部" + props.text; let label = "全部" + props.text;
if (info) { if (info) {
label = info.node.title; label = info.node.title.props.children.props.children;
} }
console.log(info);
props.onUpdate(selectedKeys, label); props.onUpdate(selectedKeys, label);
setSelectKey(selectedKeys); setSelectKey(selectedKeys);
}; };
const onExpand = (selectedKeys: any, info: any) => { const onExpand = (selectedKeys: any, info: any) => {};
let label = "全部" + props.text;
if (info) {
label = info.node.title;
}
props.onUpdate(selectedKeys, label);
setSelectKey(selectedKeys);
};
return ( return (
<div> <div>