new.vue 993 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <LayoutContainer>
  3. <div>
  4. <h2>{{ $t('create_a_new_residence_area') }}</h2>
  5. <UiFormCreation
  6. :model="ResidenceArea"
  7. go-back-route="/parameters/residence_areas"
  8. >
  9. <template #default="{ entity }">
  10. <v-container :fluid="true" class="container">
  11. <v-row>
  12. <v-col cols="12" sm="6">
  13. <UiInputText
  14. v-model="entity.label"
  15. field="label"
  16. type="string"
  17. :rules="rules()"
  18. />
  19. </v-col>
  20. </v-row>
  21. </v-container>
  22. </template>
  23. </UiFormCreation>
  24. </div>
  25. </LayoutContainer>
  26. </template>
  27. <script setup lang="ts">
  28. import { useI18n } from 'vue-i18n'
  29. import ResidenceArea from '~/models/Billing/ResidenceArea'
  30. const i18n = useI18n()
  31. const rules = () => [
  32. (label: string | null) =>
  33. (label !== null && label.length > 0) || i18n.t('please_enter_a_value'),
  34. ]
  35. </script>