-
Notifications
You must be signed in to change notification settings - Fork 449
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
[Table]在筛选的输入框中按回车键会触发表单提交 #2445
Labels
to be published
to be published
Comments
👋 @Kigoal,感谢给 TDesign 提出了 issue。 |
|
今天群里有位同学说,正好是期望触发 form 表单,不知道是你不 |
是我,我是不希望在筛选弹窗的input中触发提交。😂 // form
// 提交表单事件
const onSubmit = async () => {
const responseData = await Create(formData.value);
console.log(responseData);
};
const onSubmitClick = async () => {
const error: [boolean, boolean] = [false, false];
// 校验表单数据
if ((await formRef.value?.validate()) !== true) {
error[0] = true;
}
// 校验表格数据
if ((await tableRef.value?.validate()) !== true) {
error[1] = true;
}
if (!error.some((value) => value === true)) {
// 执行表单提交
await formRef.value?.submit();
}
};
// table
const onValidateTableData = async () => {
if (tableRef.value) {
const { result } = await tableRef.value.validateTableData();
// 这里在检验成功时返回{}而不是true
return Object.keys(result).length > 0 ? result : true;
}
return undefined;
};
defineExpose({
validate: onValidateTableData,
}); |
好奇一个使用场景:什么样的情况下会把 Table 放在 Form 中使用。印象中没有给过这样的示例 |
resolved in #2515 待发布 |
This was referenced Mar 12, 2023
This was referenced Mar 16, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tdesign-vue-next 版本
1.0.8
重现链接
无
重现步骤
期望结果
按下回车键时仅隐藏筛选的弹窗,不要触发表单校验
实际结果
按下回车时会隐藏筛选的弹窗,同时也会触发表单校验
框架版本
No response
浏览器版本
No response
系统版本
No response
Node版本
No response
补充说明
No response
The text was updated successfully, but these errors were encountered: