mirror of https://github.com/ElemeFE/element
MessageBox: Add attribute 'showClose' to doc (#8516)
* MessageBox: Add attribute 'showClose' to doc Add an attribute 'showClose' to explain whether to show 'close' button on the right top. MessageBox: 文档中添加一个属性:showClose。 用来解释是否显示 MessageBox 右上角的关闭按钮。改属性,已经在源码中声明。 * MessageBox: Add attribute 'showClose' to doc Add an attribute 'showClose' to explain whether to show 'close' button on the right top.pull/8531/head
parent
6e8f10a556
commit
675253dcb1
|
@ -380,6 +380,7 @@ The corresponding methods are: `MessageBox`, `MessageBox.alert`, `MessageBox.con
|
|||
| type | message type, used for icon display | string | success / info / warning / error | — |
|
||||
| customClass | custom class name for MessageBox | string | — | — |
|
||||
| callback | MessageBox closing callback if you don't prefer Promise | function(action), where action can be 'confirm' or 'cancel', and `instance` is the MessageBox instance. You can access to that instance's attributes and methods | — | — |
|
||||
| showClose | whether to show close icon of MessageBox | boolean | — | true |
|
||||
| beforeClose | callback before MessageBox closes, and it will prevent MessageBox from closing | function(action, instance, done), where `action` can be 'confirm' or 'cancel'; `instance` is the MessageBox instance, and you can access to that instance's attributes and methods; `done` is for closing the instance | — | — |
|
||||
| lockScroll | whether to lock body scroll when MessageBox prompts | boolean | — | true |
|
||||
| showCancelButton | whether to show a cancel button | boolean | — | false (true when called with confirm and prompt) |
|
||||
|
@ -399,4 +400,4 @@ The corresponding methods are: `MessageBox`, `MessageBox.alert`, `MessageBox.con
|
|||
| inputValidator | validation function for the input. Should returns a boolean or string. If a string is returned, it will be assigned to inputErrorMessage | function | — | — |
|
||||
| inputErrorMessage | error message when validation fails | string | — | Illegal input |
|
||||
| center | whether to align the content in center | boolean | — | false |
|
||||
| roundButton | whether to use round button | boolean | — | false |
|
||||
| roundButton | whether to use round button | boolean | — | false |
|
||||
|
|
|
@ -378,6 +378,7 @@ import { MessageBox } from 'element-ui';
|
|||
| type | 消息类型,用于显示图标 | string | success / info / warning / error | — |
|
||||
| customClass | MessageBox 的自定义类名 | string | — | — |
|
||||
| callback | 若不使用 Promise,可以使用此参数指定 MessageBox 关闭后的回调 | function(action, instance),action 的值为'confirm'或'cancel', instance 为 MessageBox 实例,可以通过它访问实例上的属性和方法 | — | — |
|
||||
| showClose | MessageBox 是否显示右上角关闭按钮 | boolean | — | true |
|
||||
| beforeClose | MessageBox 关闭前的回调,会暂停实例的关闭 | function(action, instance, done),action 的值为'confirm'或'cancel';instance 为 MessageBox 实例,可以通过它访问实例上的属性和方法;done 用于关闭 MessageBox 实例 | — | — |
|
||||
| lockScroll | 是否在 MessageBox 出现时将 body 滚动锁定 | boolean | — | true |
|
||||
| showCancelButton | 是否显示取消按钮 | boolean | — | false(以 confirm 和 prompt 方式调用时为 true) |
|
||||
|
|
Loading…
Reference in New Issue