vue中提交由于页面卡顿或连续点击出现重复提交现象
在data中定义一个变量
data(){
return{
repeat:true
}
}
methods:{
isRepeat(){
if(!this.repeat){ return }
this.repeat = false;
// 发送axios请求
this.$axios.post("url",{})
.then(res=>{
// 请求成功改变repeat的值
this.repeat = true
})
.catch(err=>{
// ...
})
}
}

浙公网安备 33010602011771号