mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 09:26:06 +08:00
docs: optimize Modal static method operation description (#49752)
* docs: Optimize Modal static method operation description * docs: update
This commit is contained in:
parent
3825743a25
commit
3c525cd3b9
@ -122,8 +122,8 @@ The items listed above are all functions, expecting a settings object as paramet
|
||||
| width | Width of the modal dialog | string \| number | 416 | |
|
||||
| wrapClassName | The class name of the container of the modal dialog | string | - | 4.18.0 |
|
||||
| zIndex | The `z-index` of the Modal | number | 1000 | |
|
||||
| onCancel | Specify a function that will be called when the user clicks the Cancel button. The parameter of this function is a function whose execution should include closing the dialog. If the function does not take any parameter (`!onCancel.length`) then modal dialog will be closed unless returned value is `true` (`!!onCancel()`). You can also just return a promise and when the promise is resolved, the modal dialog will also be closed | function(close) | - | |
|
||||
| onOk | Specify a function that will be called when the user clicks the OK button. The parameter of this function is a function whose execution should include closing the dialog. If the function does not take any parameter (`!onOk.length`) then modal dialog will be closed unless returned value is `true` (`!!onOk()`). You can also just return a promise and when the promise is resolved, the modal dialog will also be closed | function(close) | - | |
|
||||
| onCancel | Click to onCancel the callback, the parameter is the closing function, if it returns a promise, resolve means normal closing, reject means not closing | function(close) | - | |
|
||||
| onOk | Click to onOk the callback, the parameter is the closing function, if it returns a promise, resolve means normal closing, reject means not closing | function(close) | - | |
|
||||
|
||||
All the `Modal.method`s will return a reference, and then we can update and close the modal dialog by the reference.
|
||||
|
||||
|
@ -123,8 +123,8 @@ demo:
|
||||
| width | 宽度 | string \| number | 416 | |
|
||||
| wrapClassName | 对话框外层容器的类名 | string | - | 4.18.0 |
|
||||
| zIndex | 设置 Modal 的 `z-index` | number | 1000 | |
|
||||
| onCancel | 取消回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function(close) | - | |
|
||||
| onOk | 点击确定回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function(close) | - | |
|
||||
| onCancel | 点击取消回调,参数为关闭函数,若返回 promise 时 resolve 为正常关闭, reject 为不关闭 | function(close) | - | |
|
||||
| onOk | 点击确定回调,参数为关闭函数,若返回 promise 时 resolve 为正常关闭, reject 为不关闭 | function(close) | - | |
|
||||
|
||||
以上函数调用后,会返回一个引用,可以通过该引用更新和关闭弹窗。
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user