align-center.vue 766 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <el-button text @click="centerDialogVisible = true">
  3. Click to open the Dialog
  4. </el-button>
  5. <el-dialog
  6. v-model="centerDialogVisible"
  7. title="Warning"
  8. width="30%"
  9. align-center
  10. >
  11. <span>Open the dialog from the center from the screen</span>
  12. <template #footer>
  13. <span class="dialog-footer">
  14. <el-button @click="centerDialogVisible = false">Cancel</el-button>
  15. <el-button type="primary" @click="centerDialogVisible = false">
  16. Confirm
  17. </el-button>
  18. </span>
  19. </template>
  20. </el-dialog>
  21. </template>
  22. <script lang="ts" setup>
  23. import { ref } from 'vue'
  24. const centerDialogVisible = ref(false)
  25. </script>
  26. <style scoped>
  27. .dialog-footer button:first-child {
  28. margin-right: 10px;
  29. }
  30. </style>