Commit fc0ba59d by wuwx

创建服务券新增防抖

1 parent febe0a92
...@@ -209,7 +209,7 @@ export default { ...@@ -209,7 +209,7 @@ export default {
}, 1000) }, 1000)
} }
return { return {
clickStatus: false, timer: Function,
isEdit: false, isEdit: false,
showSubmit: true, showSubmit: true,
disabledDescription: false, disabledDescription: false,
...@@ -403,8 +403,8 @@ export default { ...@@ -403,8 +403,8 @@ export default {
}, },
submitForm(formName) { submitForm(formName) {
if (this.clickStatus) return clearTimeout(this.timer)
this.clickStatus = true this.timer = setTimeout(() => {
this.$refs[formName].validate((valid, errorObj) => { this.$refs[formName].validate((valid, errorObj) => {
var merchantval = true var merchantval = true
var merchantErrorObj = [] var merchantErrorObj = []
...@@ -429,6 +429,7 @@ export default { ...@@ -429,6 +429,7 @@ export default {
return false return false
} }
}) })
},500)
}, },
//创建服务 //创建服务
createService() { createService() {
...@@ -508,7 +509,6 @@ export default { ...@@ -508,7 +509,6 @@ export default {
}) })
.finally(() => { .finally(() => {
this.sloading = false this.sloading = false
this.clickStatus = false
}) })
}, },
//更新服务 //更新服务
...@@ -536,7 +536,6 @@ export default { ...@@ -536,7 +536,6 @@ export default {
}) })
.finally(() => { .finally(() => {
this.sloading = false this.sloading = false
this.clickStatus = false
}) })
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!