confirm.vue 651 B

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