web123456

vant prevents duplicate submissions - loading

----- <van-button type="primary" block @click="commit" :loading="loading" loading-type="spinner" >Submit for review</van-button> --- commit() { //Submit data this.loading=true //Show loading circle 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) { //The data loaded successfully Circle false this.loading=false this.title='' this.type='' this.answer='' this.message='' } }) // setTimeout(() => { // =false // }, 2000); },