ReqChangeConfirmModal.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <SmartModal
  3. v-if="show"
  4. dialog
  5. :title="$t('modal.confirm')"
  6. aria-modal="true"
  7. @close="hideModal"
  8. >
  9. <template #body>
  10. <div class="flex flex-col px-2">
  11. <label>
  12. {{ t("confirm.request_change") }}
  13. </label>
  14. </div>
  15. </template>
  16. <template #footer>
  17. <span>
  18. <ButtonPrimary
  19. v-focus
  20. :label="t('action.save')"
  21. @click.native="saveApiChange"
  22. />
  23. <ButtonSecondary
  24. :label="t('action.dont_save')"
  25. @click.native="discardApiChange"
  26. />
  27. </span>
  28. <ButtonSecondary :label="t('action.cancel')" @click.native="hideModal" />
  29. </template>
  30. </SmartModal>
  31. </template>
  32. <script setup lang="ts">
  33. import { useI18n } from "~/helpers/utils/composables"
  34. const t = useI18n()
  35. defineProps<{
  36. show: Boolean
  37. }>()
  38. const emit = defineEmits<{
  39. (e: "save-change"): void
  40. (e: "discard-change"): void
  41. (e: "hide-modal"): void
  42. }>()
  43. const saveApiChange = () => {
  44. emit("save-change")
  45. }
  46. const discardApiChange = () => {
  47. emit("discard-change")
  48. }
  49. const hideModal = () => {
  50. emit("hide-modal")
  51. }
  52. </script>