<template>
  <v-container
    class="px-0"
    fluid
  >
    <v-checkbox
      :value="data"
      :label="$t(label_field)"
      @change="$emit('update', $event, field)"
      :disabled="readOnly"
    ></v-checkbox>
  </v-container>
</template>

<script lang="ts">
  import {defineComponent} from '@nuxtjs/composition-api'

  export default defineComponent({
    props: {
      field: {
        type: String,
        required: false
      },
      label: {
        type: String,
        required: false
      },
      data: {
        type: Boolean,
        required: false
      },
      readOnly: {
        type: Boolean,
        required: false
      },
    },
    setup(props){
      return {
        label_field : props.label ?? props.field,
      }
    }
  })
</script>

<style scoped>
</style>
