1.css
.switch{
 pointer-events:none
}

2.js
var App = new Vue({
  template: '<i-switch @click="change" :value="open"class="switch" ></i-switch>',
  data(){
    return {
      open:false
    }
  },
  methods:{
    change(open){
      this.$Modal.confirm({
        title: '切换提示',
        content: '<p>开关状态即将发生更改,是否继续</p>',
        onOk: () => {
          this.open = true;
          this.$Message.info('当前状态是'+ this.open);
        },

        onCancel:()=>{
          this.open = false;
          this.$Message.info('当前状态是'+ this.open);
        }
      });
    }
  }
});
  


  

相关文章:

  • 2022-12-23
  • 2021-06-30
  • 2022-02-01
  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2021-05-19
  • 2022-12-23
猜你喜欢
  • 2021-12-09
  • 2022-12-23
  • 2021-10-04
  • 2021-12-09
  • 2022-12-23
  • 2021-07-06
相关资源
相似解决方案