Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改typescript中的validate返回类型 #395

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/table-edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const formRef = ref<FormInstance>();
const saveEdit = (formEl: FormInstance | undefined) => {
if (!formEl) return;
formEl.validate(valid => {
if (!valid) return false;
if (!valid) return;
update(form.value);
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/views/element/form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ const onSubmit = (formEl: FormInstance | undefined) => {
console.log(form);
ElMessage.success('提交成功!');
} else {
return false;
ElMessage.error('表单验证失败');
}
});
};
Expand Down
1 change: 0 additions & 1 deletion src/views/pages/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ const submitForm = (formEl: FormInstance | undefined) => {
}
} else {
ElMessage.error('登录失败');
return false;
}
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/views/pages/register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const submitForm = (formEl: FormInstance | undefined) => {
ElMessage.success('注册成功,请登录');
router.push('/login');
} else {
return false;
ElMessage.error('表单验证失败');
}
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/views/pages/reset-pwd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const submitForm = (formEl: FormInstance | undefined) => {
if (valid) {
ElMessage.success('邮件已发送,请注意查收');
} else {
return false;
ElMessage.error('表单验证失败');
}
});
};
Expand Down