|
@@ -24,6 +24,7 @@
|
|
dialogFormVisible: false,
|
|
dialogFormVisible: false,
|
|
outerVisible: false,
|
|
outerVisible: false,
|
|
innerVisible: false,
|
|
innerVisible: false,
|
|
|
|
+ centerDialogVisible: false,
|
|
form: {
|
|
form: {
|
|
name: '',
|
|
name: '',
|
|
region: '',
|
|
region: '',
|
|
@@ -209,10 +210,10 @@ If a Dialog is nested in another Dialog, `append-to-body` is required.
|
|
<template>
|
|
<template>
|
|
<el-button type="text" @click="outerVisible = true">open the outer Dialog</el-button>
|
|
<el-button type="text" @click="outerVisible = true">open the outer Dialog</el-button>
|
|
|
|
|
|
- <el-dialog title="外层 Dialog" :visible.sync="outerVisible">
|
|
|
|
|
|
+ <el-dialog title="Outter Dialog" :visible.sync="outerVisible">
|
|
<el-dialog
|
|
<el-dialog
|
|
width="30%"
|
|
width="30%"
|
|
- title="内层 Dialog"
|
|
|
|
|
|
+ title="Inner Dialog"
|
|
:visible.sync="innerVisible"
|
|
:visible.sync="innerVisible"
|
|
append-to-body>
|
|
append-to-body>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -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-button type="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>
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="centerDialogVisible = false">Cancel</el-button>
|
|
|
|
+ <el-button type="primary" @click="centerDialogVisible = false">Confirm</el-button>
|
|
|
|
+ </span>
|
|
|
|
+</el-dialog>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ export default {
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ centerDialogVisible: false
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+</script>
|
|
|
|
+```
|
|
|
|
+:::
|
|
|
|
+
|
|
:::tip
|
|
:::tip
|
|
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.
|
|
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 |
|
|
| 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 |
|
|
| 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 | — | — |
|
|
| 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 | — | — |
|
|
|
|
|
|
### Slot
|
|
### Slot
|
|
|
|
|