support promise for modal

This commit is contained in:
yiminghe 2015-06-25 15:35:46 +08:00
parent dac8bc14c6
commit 82913b8610
3 changed files with 7 additions and 1 deletions

View File

@ -28,6 +28,9 @@ var Test = React.createClass({
},
handleCancel() {
console.log('点击了取消');
this.setState({
visible: false
});
},
render() {
return <div>

View File

@ -34,6 +34,9 @@ var Test = React.createClass({
},
handleCancel() {
console.log('点击了取消');
this.setState({
visible: false
});
},
render() {
return <div>

View File

@ -22,7 +22,7 @@
|------------|----------------|------------------|--------------|
| title | 标题 | React.Element | 无 |
| onOk | 点击确定回调 | function | 无 |
| onCancel | 点击遮罩层或右上角叉或取消按钮的回调,返回 promise 时 resolve 后自动关闭 | function | 无 |
| onCancel | 点击遮罩层或右上角叉或取消按钮的回调 | function | 无 |
| width | 宽度 | String or Number | 500 |
| footer | 底部内容 | React.Element | 确定取消按钮 |