Merge branch 'Rohanhacker-feature' into feature-3.1

This commit is contained in:
Wei Zhu 2017-12-28 16:26:44 +08:00
commit e8a9ca0d2a
4 changed files with 11 additions and 8 deletions

View File

@ -36,6 +36,7 @@ export interface ModalProps {
cancelText?: string;
/** 点击蒙层是否允许关闭*/
maskClosable?: boolean;
destroyOnClose?: boolean;
style?: React.CSSProperties;
wrapClassName?: string;
maskTransitionName?: string;

View File

@ -23,6 +23,7 @@ and so on.
| cancelText | Text of the Cancel button | string | `Cancel` |
| closable | Whether a close (x) button is visible on top right of the modal dialog or not | boolean | true |
| confirmLoading | Whether to apply loading visual effect for OK button or not | boolean | false |
| destroyOnClose | Whether to unmount child compenents on onClose | boolean | false |
| footer | Footer content, set as `footer={null}` when you don't need default buttons | string\|ReactNode | OK and Cancel buttons |
| getContainer | Return the mount node for Modal | (instance): HTMLElement | () => document.body |
| mask | Whether show mask or not. | Boolean | true |
@ -36,13 +37,14 @@ and so on.
| width | Width of the modal dialog | string\|number | 520 |
| wrapClassName | The class name of the container of the modal dialog | string | - |
| zIndex | The `z-index` of the Modal | Number | 1000 |
| onCancel | Specify a function that will be called when a user clicks mask, close button on top right or Cancel button | function(e) | - |
| onCancel | Specify a function that will be called when a user clicks mask, close button on top right or Cancel button |
function(e) | - |
| onOk | Specify a function that will be called when a user clicks the OK button | function(e) | - |
#### Destroy on close
#### Note
> The state of Modal will be preserved at it's component lifecycle by default, if you wish to open it with a brand new state everytime, set `destroyOnClose` on it.
> The state of Modal will be preserved at it's component lifecycle.
> If you wish to open it with a brand new state everytime, you need to reset state manually.
### Modal.method()

View File

@ -22,6 +22,7 @@ title: Modal
| cancelText | 取消按钮文字 | string | 取消 |
| closable | 是否显示右上角的关闭按钮 | boolean | true |
| confirmLoading | 确定按钮 loading | boolean | 无 |
| destroyOnClose | 关闭时销毁 Modal 里的子元素 | boolean | false |
| footer | 底部内容,当不需要默认底部按钮时,可以设为 `footer={null}` | string\|ReactNode | 确定取消按钮 |
| getContainer | 指定 Modal 挂载的 HTML 节点 | (instance): HTMLElement | () => document.body |
| mask | 是否展示遮罩 | Boolean | true |
@ -38,10 +39,9 @@ title: Modal
| onCancel | 点击遮罩层或右上角叉或取消按钮的回调 | function(e) | 无 |
| onOk | 点击确定回调 | function(e) | 无 |
#### 清空旧数据
#### 注意
> `<Modal />` 组件有标准的 React 生命周期,关闭后状态不会自动清空。
> 如果希望每次打开都是新内容,需要自行手动清空旧的状态。
> `<Modal />` 默认关闭后状态不会自动清空, 如果希望每次打开都是新内容,请设置 `destroyOnClose`
### Modal.method()

View File

@ -55,7 +55,7 @@
"rc-cascader": "~0.12.0",
"rc-checkbox": "~2.1.1",
"rc-collapse": "~1.7.5",
"rc-dialog": "~7.0.3",
"rc-dialog": "~7.1.0",
"rc-dropdown": "~2.1.0",
"rc-editor-mention": "^1.0.2",
"rc-form": "^2.1.0",