在提交按钮添加loading,通过loading状态防止多次点击
Element:https://element.eleme.cn/2.13/#/zh-CN/component/button
<div class="flex-c">
<el-button type="primary" @click="getModifyPersonalInfo(form)" :loading="loading">保存</el-button>
</div>
export default {
data() {
return {
loading: false
}
}
methods: {
getModifyPersonalInfo(form) {
this.$refs.form.validate((valid) => {
if (valid && this.form.hjdxzqh != "110000000000") {
this.loading = true
const params = { ...this.form }
modifyPersonalInfo(params).then((res) => {
this.$message.success("保存成功")
})
.finally(() => {
this.loading = false
})
} else {
this.$message.error("您的个人信息输入有误,请查证后修改(若您的户籍地行政区划为北京市的请精确到区级)")
}
})
}
}
417

被折叠的 条评论
为什么被折叠?



