解决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>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM