html部分:
<el-button type="primary" :disabled="!isClick" @click="isClick&&handleLogin()">登录</el-button>
script部分
<script>
export default {
data() {
return {
isClick: true
}
},
methods: {
handleLogin() {
this.isClick = false
this.$http( //发送异步请求
// 请求相关
).then(() => {
this.isClick = true //请求完成时恢复事件绑定
})
}
}
}
</script>