ant-design-vue
ant-design-vue copied to clipboard
fix(form): fix useForm validation when key is not in modelRef
First of all, thank you for your contribution! π
New feature please send pull request to feature branch, and rest to master branch. Pull request will be merged after one of collaborators approve. Please makes sure that these form are filled before submitting your pull request, thank you!
[δΈζηζ¨‘ζΏ / Chinese template]
This is a ...
- [ ] New feature
- [x] Bug fix
- [ ] Site / document update
- [ ] Component style update
- [ ] TypeScript definition update
- [ ] Refactoring
- [ ] Code style optimization
- [ ] Branch merge
- [ ] Other (about what?)
What's the background?
- Describe the source of requirement. a. Dealing with large form, declaring all keys is inconvenient. It is expected that all keys in rules should be validated. b. After fetching data from server and set modelRef, keys which are not in modelRef won't be validated.
- Resolve what problem. With the changes, keys in rules will be validated except for modelFn.
- Related issue link. https://codesandbox.io/s/useform-basic-usage-ant-design-vue-3-2-11-forked-g08zd3?file=/src/demo.vue
Self Check before Merge
- [x] Doc is updated/provided or not needed
- [x] Demo is updated/provided or not needed
- [x] TypeScript definition is updated/provided or not needed
- [x] Changelog is provided or not needed