align-center.vue 820 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <kk-button text @click="centerDialogVisible = true">
  3. Click to open the Dialog
  4. </kk-button>
  5. <kk-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. <kk-button @click="centerDialogVisible = false">Cancel</kk-button>
  15. <kk-button type="primary" @click="centerDialogVisible = false">
  16. Confirm
  17. </kk-button>
  18. </span>
  19. </template>
  20. </kk-dialog>
  21. </template>
  22. <script lang="ts" setup>
  23. import { ref } from 'vue'
  24. import { KkButton, KkDialog } from 'kankan-components'
  25. const centerDialogVisible = ref(false)
  26. </script>
  27. <style scoped>
  28. .dialog-footer button:first-child {
  29. margin-right: 10px;
  30. }
  31. </style>