提交 4f381b03 编写于 作者: Y yiminghe

fix #120

上级 e1a6cfc7
......@@ -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>
);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册