AttendanceBookingReason.vue 891 B

123456789101112131415161718192021222324252627282930313233343536
  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([
  22. 'update:entity',
  23. ])
  24. // Pour éviter l'erreur eslint "Unexpected mutation of "modelValue" prop"
  25. const localEntity = computed({
  26. get: () => props.entity,
  27. set: (value) => emit('update:entity', value)
  28. })
  29. const getAsserts = (key) => getAssertUtils(AttendanceBookingReason.getAsserts(), key)
  30. </script>