鍍金池/ 問(wèn)答/網(wǎng)絡(luò)安全  HTML/ vue-resourse 怎么防止表單重復(fù)提交?

vue-resourse 怎么防止表單重復(fù)提交?

nextStep() {

  let URL = this.__WEBSERVERURL__ + "/oauth/userreport/submit";
  let params = {
    name: this.customer.name,
    certNo: this.customer.idCard,
    mobile: this.customer.mobile
  };

  if (!params.name || !params.certNo || !params.mobile) {
    this.$Message.error("用戶名,身份證,手機(jī)號(hào)必填!");
    return;
  }

  this.$http.post(URL, params).then(res => {
    if (res.body.code == 0) {
      console.log(res.body);
      this.$router.push({
        name: "CreditReportDetail",
        query: {
          id: res.body.reportId
        }
      });
    } else {
      this.$Message.error(res.body.msg);
    }
  });
}


=================
怎么讓點(diǎn)了button按鈕提交后 ,禁用點(diǎn)擊防止再次提交  ,防止多次點(diǎn)擊 
回答
編輯回答
心沉

可以運(yùn)用節(jié)流函數(shù)
http://www.alloyteam.com/2012...

2017年5月10日 01:03
編輯回答
傻叼

設(shè)置一個(gè)變量標(biāo)識(shí),初始為false,點(diǎn)擊提交按鈕后變?yōu)閠rue,如果為true則發(fā)出請(qǐng)求,請(qǐng)求完畢再重置為false

2018年7月7日 11:18