alert.vue 557 B

12345678910111213141516171819202122
  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, KkMessageBox } from 'kankan-components'
  6. import type { Action } from 'element-plus'
  7. const open = () => {
  8. KkMessageBox.alert('This is a message', 'Title', {
  9. // if you want to disable its autofocus
  10. // autofocus: false,
  11. confirmButtonText: 'OK',
  12. callback: (action: Action) => {
  13. // ElMessage({
  14. // type: 'info',
  15. // message: `action: ${action}`,
  16. // })
  17. },
  18. })
  19. }
  20. </script>