防止按钮重复提交

以uniapp项目为例

<button class="cu-btn bg-grey lg" @click="submit" :disabled="disabled" :loading="disabled">提交</button>

data() {
    return {
      disabled: false
    }
}

submit(){
    this.disabled = true;
    //post 响应完成后
    this.disabled = false;
}

 526 total views,  4 views today

Revisions

Comments are closed.