<template>
  <div class="el-checkbox-card">
    <checkbox v-bind="$props" @change="change" @input="handleInput">
      <template v-slot:default>
        <slot></slot>
      </template>
    </checkbox>
  </div>
</template>
<script>
  import Emitter from 'modesign-ui/src/mixins/emitter';
  import checkbox from './checkbox.vue'

  export default {
    name: 'ElCheckboxCard',

    mixins: [Emitter],

    components: {
      checkbox
    },

    data() {
      return {};
    },

    methods: {
      change(value, ev) {
        this.$emit('change', value, ev);
      },

      handleInput(val) {
        this.$emit('input', val);
      },
    },

    props: {
      value: {},
      label: {},
      extra: {},
      indeterminate: Boolean,
      disabled: Boolean,
      checked: Boolean,
      name: String,
      trueLabel: [String, Number],
      falseLabel: [String, Number],
      id: String, /* 当indeterminate为真时，为controls提供相关连的checkbox的id，表明元素间的控制关系*/
      controls: String, /* 当indeterminate为真时，为controls提供相关连的checkbox的id，表明元素间的控制关系*/
      border: Boolean,
      size: String
    }
  };
</script>
