Checkbox.vue 817 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <!--
  2. Case à cocher
  3. @see https://vuetifyjs.com/en/components/checkboxes/
  4. -->
  5. <template>
  6. <v-container
  7. class="px-0"
  8. fluid
  9. >
  10. <v-checkbox
  11. :value="data"
  12. :label="$t(label_field)"
  13. :disabled="readOnly"
  14. @change="$emit('update', $event, field)"
  15. />
  16. </v-container>
  17. </template>
  18. <script lang="ts">
  19. import { defineComponent } from '@nuxtjs/composition-api'
  20. export default defineComponent({
  21. props: {
  22. field: {
  23. type: String,
  24. required: false
  25. },
  26. label: {
  27. type: String,
  28. required: false
  29. },
  30. data: {
  31. type: Boolean,
  32. required: false
  33. },
  34. readOnly: {
  35. type: Boolean,
  36. required: false
  37. }
  38. },
  39. setup (props) {
  40. return {
  41. label_field: props.label ?? props.field
  42. }
  43. }
  44. })
  45. </script>
  46. <style scoped>
  47. </style>