refactor: ♻️ 使用 useThrottleFn 替代 useDebounceFn,第一次点击立即执行,连续点击不重复提交
Former-commit-id: 04724284e7f4ec30d54a6f0eaec2770818c650e9
This commit is contained in:
@@ -231,7 +231,7 @@ function resetForm() {
|
||||
/**
|
||||
* 表单提交
|
||||
*/
|
||||
const handleSubmit = useDebounceFn(() => {
|
||||
const handleSubmit = useThrottleFn(() => {
|
||||
userFormRef.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
const userId = formData.id;
|
||||
@@ -255,7 +255,7 @@ const handleSubmit = useDebounceFn(() => {
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
}, 3000);
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
|
||||
Reference in New Issue
Block a user