AttendanceBookingReason.vue 888 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  2. <v-container :fluid="true" class="container">
  3. <v-row>
  4. <v-col cols="12" sm="6">
  5. <UiInputText
  6. v-model="localEntity.reason"
  7. field="reason"
  8. type="string"
  9. :rules="getAsserts('reason')"
  10. />
  11. </v-col>
  12. </v-row>
  13. </v-container>
  14. </template>
  15. <script setup lang="ts">
  16. import AttendanceBookingReason from '~/models/Booking/AttendanceBookingReason'
  17. import { getAssertUtils } from '~/services/asserts/getAssertUtils'
  18. const props = defineProps<{
  19. entity: AttendanceBookingReason
  20. }>()
  21. const emit = defineEmits(['update:entity'])
  22. // Pour éviter l'erreur eslint "Unexpected mutation of "modelValue" prop"
  23. const localEntity = computed({
  24. get: () => props.entity,
  25. set: (value) => emit('update:entity', value),
  26. })
  27. const getAsserts = (key) =>
  28. getAssertUtils(AttendanceBookingReason.getAsserts(), key)
  29. </script>