<template>
  <y-button :type="btnStyle" :simple="simple" @click="click">
    <slot></slot>
  </y-button>
</template>
<script>
import { Button } from "../button";
import emitter from "yt-ui/src/mixins/emitter";
export default {
  name: "YCheckboxButton",
  components: { "y-button": Button },
  mixins: [emitter],
  props: {
  	value: { type: Array, default: () => [] },
    label: String
  },
  data() {
    return {
      actived: false,
      simple: false
    };
  },
  computed: {
    btnStyle() {
    	console.log(this.simple)
      if (this.simple) {
        return this.actived ? "checkboxBack" : "plain";
      } else {
        return this.actived ? "checkboxBorder" : "plain";
      }
    }
  },
  methods: {
    click(event) {
    	this.actived = !this.actived;
    }
  }
};
</script>