<template>
  <el-checkbox v-model="model" :true-label="trueLabel" :false-label="falseLabel" v-bind="$attrs" v-on="$listeners" v-bind:disabled="isDisable">
    <slot></slot>
  </el-checkbox>
</template>

<script>
export default {
  props: {
    value: {
      type: String | Boolean,
      default: ''
    },
    disabled: {
      type: Boolean,
      default: false
    },
    "true-label":{
      type:String,
      default:"X"
    },
    "false-label":{
      type:String,
      default:""
    }
  },
  computed: {
    model: {
      get () {
        return this.value
      },
      set (newVal) {
        this.$emit('input', newVal)
      }
    },
    mode () {
      return this.$store.state.Status.mode
    },
    isDisable: {
      get () {
        return this.mode === 'display' || this.disabled
      }
    }
  }
}
</script>