import { Row, Col, Button, Dropdown, Menu } from 'antd' const Item = Menu.Item import cloneDeep from 'lodash/cloneDeep' class Main extends React.Component { constructor(props) { super(props); this.state = { showDrop: false, } } render() { const { showDrop } = this.state; const { icon, buttons, buttonSpace, showDropIcon, dropMenuDatas } = this.props; //isFixed:hrm-my-card-top是否固定 const menu = dropMenuDatas ? { dropMenuDatas.forEach(d => d.key === o.key && typeof d.onClick === 'function' && d.onClick(o.key)); }}> { dropMenuDatas && dropMenuDatas.map((d, i)=> { return ( {d.icon} {d.content} ) })} : ''; return (
{ buttons && buttons.map((data)=>{ return ( {data} ) }) } { showDropIcon && (buttons.length > 0) && this.setState({showDrop:true})}> }
this.setState({showDrop:false})} style={{display:showDrop ? 'block' : 'none'}}> this.setState({showDrop:false})}>
{menu}
) } } export default Main;