<template>
  <div class="switch-box">
    <hive-switch checkedVal="开" unCheckedVal="关" @onClick="onHandleClick"></hive-switch>
    <hive-switch checkedIcon="tick" unCheckedIcon ="clear" @onChange="onHandleChange"></hive-switch>
  </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>
