Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2025-02-17 15:04:46 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e69296cd11a0462d6739113cafe1ec7f6cf831d7
e69296cd
1 parent
e624a8dc
fix 错误提示优化,显示具体错误信息
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
src/views/index.vue
src/views/index.vue
View file @
e69296c
<!--
* @Date: 2022-07-18 10:22:22
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-02-1
3 16:28:32
* @LastEditTime: 2025-02-1
7 15:02:03
* @FilePath: /data-table/src/views/index.vue
* @Description: 首页
-->
...
...
@@ -1160,7 +1160,15 @@ const onSubmit = async (values) => { // 表单提交回调
};
const onFailed = (errorInfo) => { // 提交表单且验证不通过后触发
showToast('有填写错误,请检查')
const error_item = errorInfo.errors[0];
// 通过name找到对应的label
let error_name = '';
formData.value.forEach(item => {
if (item.key === error_item.name) {
error_name = item.component_props.label
}
});
showToast(error_name + ': ' + error_item.message);
}
</script>
...
...
Please
register
or
login
to post a comment