ant-design/components/dropdown/dropdown-button.jsx

39 lines
765 B
React
Raw Normal View History

2015-12-02 15:18:15 +08:00
import React from 'react';
import Button from '../button';
import Icon from '../icon';
import Dropdown from './dropdown';
const ButtonGroup = Button.Group;
const align = {
points: ['tr', 'br'],
overlay: {
adjustX: 1,
adjustY: 1,
},
offset: [0, 3],
targetOffset: [0, 0],
};
export default React.createClass({
getDefaultProps() {
return {
2016-01-05 14:42:06 +08:00
align,
2015-12-02 15:18:15 +08:00
type: 'default',
};
},
render() {
return (
<ButtonGroup className="ant-dropdown-button">
2015-12-02 15:18:15 +08:00
<Button type={this.props.type}>
{this.props.children}
2015-12-02 15:18:15 +08:00
</Button>
<Dropdown {...this.props}>
<Button type={this.props.type}>
<Icon type="down" />
</Button>
</Dropdown>
</ButtonGroup>
);
2015-12-02 15:18:15 +08:00
}
});