ant-design-vue icon indicating copy to clipboard operation
ant-design-vue copied to clipboard

fix(form): fix useForm validation when key is not in modelRef

Open FrankCheungDev opened this issue 2 years ago β€’ 0 comments

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?

  1. 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.
  2. Resolve what problem. With the changes, keys in rules will be validated except for modelFn.
  3. 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

FrankCheungDev avatar Aug 09 '22 09:08 FrankCheungDev