@@ -236,6 +237,40 @@ If a Dialog is nested in another Dialog, `append-to-body` is required.
```
:::
:::
### Align in center
Make the dialog's header & footer align in center
:::demo Set `center` to `true` will align dialog's header & footer in center,while the content of it will not, to prevent breaking your own content's layout
```html
<el-buttontype="text"@click="centerDialogVisible = true">Click to open the Dialog</el-button>
<el-dialog
title="Warning"
:visible.sync="centerDialogVisible"
width="30%"
center>
<span>It should be noted that the content will not be aligned in center by default</span>
If the variable bound to `visible` is managed in Vuex store, the `.sync` can not work properly. In this case, please remove the `.sync` modifier, listen to `open` and `close` events of Dialog, and commit Vuex mutations to update the value of that variable in the event handlers.
:::
...
...
@@ -258,6 +293,7 @@ If the variable bound to `visible` is managed in Vuex store, the `.sync` can not
| close-on-press-escape | whether the Dialog can be closed by pressing ESC | boolean | — | true |
| show-close | whether to show a close button | boolean | — | true |
| before-close | callback before Dialog closes, and it will prevent Dialog from closing | function(done),done is used to close the Dialog | — | — |
| center | whether to align the header and footer in center | function(done),done is used to close the Dialog | — | — |