解决vue 按钮多次点击重复提交问题

<Button type="primary" @click="bookok" :disabled="isDisable">确定</Button>
<script>
    export default {
         return {
                isDisable: false,//表单重复提交
          },
          methods: {
           bookok() {
	    	  this.isDisable = true  //开始可以点击
		      this.post("api/student/Bespeak/getBespeak", {
		          'stuId':this.rowData.stuId,
			        'bespeakId':this.rowData.bespeakId,
			        'courseId':this.courseId
		      }).then(data => {
		      	 this.isDisable = false;//执行请求后就不能点击了
		        if (data.code == 0) {
		        	this.isShow = true
		        	this.$Message.success("预约成功");
							this.btnSearch() 
		        } else {
		          this.$Message.error(data.msg);
		        }
		      });
	    },
          } 
    }
</script>
上一篇:jenkins修改数据存放路径


下一篇:微信小程序——动态设置swiper的高度