?
function xx(id, title) {
this.h=function(key) {
console.log(key);
}
}
const content = (node) => {
const { key:id, title } = node.dataRef;
return (
// <Menu onClickMenuItem={new xx(id, title).h} className="text-14px p-5px">
<Menu onClickMenuItem={onMenuItemClick(id, title)} className="text-14px p-5px">
<Menu.Item key="addDepart" className="flex items-center rounded-4px">
添加部门
</Menu.Item>
<Menu.Item key="modifyFirm" className="box-center rounded-4px">
修改企业
</Menu.Item>
<Menu.Item key="modifyDepart" className="box-center rounded-4px">
修改部门
</Menu.Item>
<Menu.Item key="removeDepart" className="box-center rounded-4px">
删除部门
</Menu.Item>
</Menu>
);}
function onMenuItemClick(id, title) {
// key 是 点击菜单项的回调的默认参数
return(key)=>{
console.log(key);
}
}
|