ant-design-vue
ant-design-vue copied to clipboard
Form.useForm may have errors in validate in nested forms
- [ ] I have searched the issues of this repository and believe that this is not a duplicate.
Version
3.3.0-beta.2
Environment
all
Reproduction link
https://antdv.com/components/form-cn#components-form-demo-useForm-nested
Steps to reproduce
- 案例同 https://antdv.com/components/form-cn#components-form-demo-useForm-nested
- validate使用参数['name', 'sub.name']
What is expected?
- 案例同 https://antdv.com/components/form-cn#components-form-demo-useForm-nested
- validate使用参数['name', 'sub.name']
What is actually happening?
与预期不同
{ name: 'fafd', sub.name: 'fsafdsadf' }
validate(['name', 'sub.name'])
.then((res) => {
console.log("form: ", res);
})
.catch((err) => {
console.log("error", err);
});
目前只能这样了
form.validate(fields).then((res) =>
Object.keys(res).reduce((pre, k) => {
_.set(pre, k, res[k]);
return pre;
}, {})
);
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.