AppDialog.vue 859B

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