centered-content.vue 698 B

123456789101112131415161718192021222324252627282930313233
  1. <template>
  2. <kk-button text @click="open">Click to open Message Box</kk-button>
  3. </template>
  4. <script lang="ts" setup>
  5. import { ElMessage } from 'element-plus'
  6. import { KkButton, KkMessageBox } from 'kankan-components'
  7. const open = () => {
  8. KkMessageBox.confirm(
  9. 'proxy will permanently delete the file. Continue?',
  10. 'Warning',
  11. {
  12. confirmButtonText: 'OK',
  13. cancelButtonText: 'Cancel',
  14. type: 'warning',
  15. center: true,
  16. }
  17. )
  18. .then(() => {
  19. ElMessage({
  20. type: 'success',
  21. message: 'Delete completed',
  22. })
  23. })
  24. .catch(() => {
  25. ElMessage({
  26. type: 'info',
  27. message: 'Delete canceled',
  28. })
  29. })
  30. }
  31. </script>