docs(components): message-box (#14179)

update message-box options

closed #14178
This commit is contained in:
刘臻 2023-09-04 21:39:22 +08:00 committed by GitHub
parent 86beacee50
commit ce2315d734
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,16 +159,16 @@ The corresponding methods are: `ElMessageBox`, `ElMessageBox.alert`, `ElMessageB
### Options
| Name | Description | Type | Default |
|------------------------------| ---------------------------------------------------------------------------------------------------------------------------------------- |------------------------------------------------------------------------------------| ------------------------------------------------ |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------ |
| autofocus | auto focus when open MessageBox | ^[boolean] | true |
| title | title of the MessageBox | ^[string] | '' |
| message | content of the MessageBox | ^[string] / ^[VNode] / ^[Function]`() => VNode` ^(2.2.17) | — |
| dangerouslyUseHTMLString | whether `message` is treated as HTML string | ^[boolean] | false |
| type | message type, used for icon display | ^[enum]`'success' \ | 'info' \| 'warning' \| 'error'` | '' |
| type | message type, used for icon display | ^[enum]`'success' \| 'info' \| 'warning' \| 'error'` | '' |
| icon | custom icon component, overrides `type` | ^[string] / ^[Component] | '' |
| custom-class | custom class name for MessageBox | ^[string] | '' |
| custom-style | custom inline style for MessageBox | ^[CSSProperties] | {} |
| callback | MessageBox closing callback if you don't prefer Promise | ^[Function]`(value: string, action: Action) => any \ | (action: Action) => any` | null |
| callback | MessageBox closing callback if you don't prefer Promise | ^[Function]`(value: string, action: Action) => any \| (action: Action) => any` | null |
| showClose | whether to show close icon of MessageBox | ^[boolean] | true |
| before-close | callback before MessageBox closes, and it will prevent MessageBox from closing | ^[Function]`(action: Action, instance: MessageBoxState, done: () => void) => void` | null |
| distinguish-cancel-and-close | whether to distinguish canceling and closing the MessageBox | ^[boolean] | false |