align-center.vue 767 B

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