FormButtons.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <script setup>
  2. const props = defineProps({
  3. showCancelButton: {
  4. type: Boolean,
  5. default: false
  6. },
  7. isBusy: {
  8. type: Boolean,
  9. default: false
  10. },
  11. isDisabled: {
  12. type: Boolean,
  13. default: false
  14. },
  15. caption: {
  16. type: String,
  17. default: 'commons.submit'
  18. },
  19. cancelLandingView: {
  20. type: String,
  21. default: ''
  22. },
  23. color: {
  24. type: String,
  25. default: 'is-link'
  26. },
  27. submitId: {
  28. type: String,
  29. default: 'btnSubmit'
  30. },
  31. cancelId: {
  32. type: String,
  33. default: 'btnCancel'
  34. },
  35. })
  36. </script>
  37. <template>
  38. <div class="field is-grouped">
  39. <div class="control">
  40. <VueButton :id="submitId" :color="color" :isLoading="isBusy" :disabled="isDisabled" >
  41. {{ $t(caption) }}
  42. </VueButton>
  43. </div>
  44. <div class="control" v-if="showCancelButton">
  45. <RouterLink :id="cancelId" :to="{ name: cancelLandingView }" class="button is-text">
  46. {{ $t('commons.cancel') }}
  47. </RouterLink>
  48. </div>
  49. </div>
  50. </template>