AppDialog.vue 895B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <script setup>
  2. defineProps({
  3. message: {
  4. type: String,
  5. default: null,
  6. },
  7. header: {
  8. type: String,
  9. default: 'Peringatan',
  10. },
  11. cancelLabel: {
  12. type: String,
  13. default: 'Tidak',
  14. },
  15. agreeLabel: {
  16. type: String,
  17. default: 'Ya',
  18. },
  19. })
  20. defineEmits(['cancel', 'agree'])
  21. </script>
  22. <template>
  23. <Dialog :header="header" :style="{ width: '450px' }" :modal="true" :breakpoints="{ '960px': '75vw' }">
  24. <div class="flex align-items-center justify-content-center">
  25. <i class="pi pi-exclamation-triangle mr-3" style="font-size: 2rem" />
  26. <p v-if="message">{{ message }}</p>
  27. </div>
  28. <template #footer>
  29. <Button :label="cancelLabel" icon="pi pi-times" class="p-button-text" @click="$emit('cancel')" />
  30. <Button :label="agreeLabel" icon="pi pi-check" class="p-button-text" @click="$emit('agree')" />
  31. </template>
  32. </Dialog>
  33. </template>