pull/123/head^2
yiminghe 10 years ago
parent e1a6cfc72a
commit 4f381b0301

@ -13,22 +13,29 @@ export default React.createClass({
transitionName: '',
placement: 'top',
trigger: 'click',
onConfirm: function() {},
onCancel: function() {}
onConfirm: function () {
},
onCancel: function () {
}
};
},
confirm: function() {
confirm: function () {
this.props.onConfirm.call(this);
this.setState({
visible: false
});
},
cancel: function() {
cancel: function () {
this.props.onCancel.call(this);
this.setState({
visible: false
});
},
onVisibleChange(v){
this.setState({
visible: v
});
},
render() {
const overlay = <div>
<div className={prefixCls + '-content'}>
@ -36,6 +43,7 @@ export default React.createClass({
<i className="anticon anticon-exclamation-circle"></i>
{this.props.title}
</p>
<div className={prefixCls + '-buttons'}>
<button onClick={this.cancel} className="ant-btn ant-btn-sm"> </button>
<button onClick={this.confirm} className="ant-btn ant-btn-primary ant-btn-sm"> </button>
@ -52,12 +60,13 @@ export default React.createClass({
return (
<Tooltip placement={this.props.placement}
prefixCls={prefixCls}
renderPopupToBody={false}
transitionName={transitionName}
visible={this.state.visible}
trigger={this.props.trigger}
overlay={overlay}>
prefixCls={prefixCls}
renderPopupToBody={false}
onVisibleChange={this.onVisibleChange}
transitionName={transitionName}
visible={this.state.visible}
trigger={this.props.trigger}
overlay={overlay}>
{this.props.children}
</Tooltip>
);

Loading…
Cancel
Save