centered-content.vue 843 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  2. <kk-button text @click="centerDialogVisible = true">
  3. Click to open the Dialog
  4. </kk-button>
  5. <kk-dialog v-model="centerDialogVisible" title="Warning" width="30%" center>
  6. <span>
  7. It should be noted that the content will not be aligned in center by
  8. default
  9. </span>
  10. <template #footer>
  11. <span class="dialog-footer">
  12. <kk-button @click="centerDialogVisible = false">Cancel</kk-button>
  13. <kk-button type="primary" @click="centerDialogVisible = false">
  14. Confirm
  15. </kk-button>
  16. </span>
  17. </template>
  18. </kk-dialog>
  19. </template>
  20. <script lang="ts" setup>
  21. import { ref } from 'vue'
  22. import { KkButton, KkDialog } from 'kankan-components'
  23. const centerDialogVisible = ref(false)
  24. </script>
  25. <style scoped>
  26. .dialog-footer button:first-child {
  27. margin-right: 10px;
  28. }
  29. </style>