Add propTypes and prop align in Modal docs

This commit is contained in:
afc163 2016-03-14 11:46:48 +08:00
parent 1929f7db97
commit 80d6ae30a8
2 changed files with 19 additions and 3 deletions

View File

@ -1,4 +1,4 @@
import React from 'react';
import React, { PropTypes } from 'react';
import Dialog from 'rc-dialog';
import { Dom } from 'rc-util';
import Button from '../button';
@ -8,7 +8,7 @@ function noop() {}
let mousePosition;
let mousePositionEventBinded;
let AntModal = React.createClass({
const AntModal = React.createClass({
getDefaultProps() {
return {
prefixCls: 'ant-modal',
@ -24,6 +24,21 @@ let AntModal = React.createClass({
};
},
propTypes: {
prefixCls: PropTypes.string,
onOk: PropTypes.func,
onCancel: PropTypes.func,
okText: PropTypes.node,
cancelText: PropTypes.node,
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
confirmLoading: PropTypes.bool,
visible: PropTypes.bool,
align: PropTypes.object,
footer: PropTypes.node,
title: PropTypes.node,
closable: PropTypes.bool,
},
handleCancel(e) {
this.props.onCancel(e);
},

View File

@ -30,7 +30,8 @@
| footer | 底部内容 | React.Element | 确定取消按钮 |
| okText | 确认按钮文字 | String | 确定 |
| cancelText | 取消按钮文字 | String | 取消 |
| maskClosable | 点击蒙层是否允许关闭 | Boolean | true |
| maskClosable | 点击蒙层是否允许关闭 | Boolean | true |
| align | 浮层自定义位置 | Object, [dom-align](https://github.com/yiminghe/dom-align) | 距离顶部 100px |
### Modal.xxx()