vant防止重复提交-loading

时间:2025-04-05 08:33:33
----- <van-button type="primary" block @click="commit" :loading="loading" loading-type="spinner" >提交审核</van-button> --- commit() { //提交数据 this.loading=true //显示加载转圈圈 axios.post(':7002/subject/add',{ section_id:1, title:this.title, answer:this.answer, section_name:this.type, desc:this.message }) .then(res => { console.log(res) if (res.data.success) { //数据加载成功 圈圈false this.loading=false this.title='' this.type='' this.answer='' this.message='' } }) // setTimeout(() => { // =false // }, 2000); },