<template>
    <div class="ht-base-switch-prevent-switch-demo">
      <ht-base-switch :before-change="handleBeforeChange" />
    </div>
</template>

<script>
  export default {
    name: 'HtBaseSwitchPreventSwitchDemo',
    methods: {
        handleBeforeChange () {
            return new Promise((resolve) => {
                this.$Modal.confirm({
                    title: '切换确认',
                    content: '您确认要切换开关状态吗？',
                    onOk: () => {
                        resolve();
                    }
                });
            });
        }
    }
  }
</script>
<style lang="less">
    .ht-base-switch-prevent-switch-demo {

    }
</style>

