Checkbox.vue 738 B

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