iview 开关变化时控制状态的变更

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

2.js
var App = new Vue({
  template: '',
  data(){
    return {
      open:false
    }
  },
  methods:{
    change(open){
      this.$Modal.confirm({
        title: '切换提示',
        content: '

开关状态即将发生更改,是否继续

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

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


  

转载于:https://www.cnblogs.com/Doduo/p/10656139.html

你可能感兴趣的:(iview 开关变化时控制状态的变更)