<template>
  <div class="switch-box">
    <hive-switch
      checked-val="开"
      un-checked-val="关"
      @onClick="onHandleClick"
    />
    <hive-switch
      checked-icon="tick"
      un-checked-icon="clear"
      @onChange="onHandleChange"
    />
  </div>
</template>
<script>
export default {
  data() {
    return {
      val: false
    };
  },
  methods: {
    onHandleClick(event) {
      this.val = false;
      console.log('触发click事件，当前Switch值：' + event.target.checked);
    },
    onHandleChange(val) {
      console.log('触发Change事件，当前Switch值：' + val);
    }
  }
};
</script>
