-
-
Notifications
You must be signed in to change notification settings - Fork 50.8k
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
feat: Form.List support rules #26676
Conversation
因为 List 内的展示是开发者自定义的,所以添加了一个 ErrorList 组件。大家看一下~ @ant-design/ant-design-collaborators |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 03800f7:
|
Size Change: +491 B (0%) Total Size: 881 kB
ℹ️ View Unchanged
|
试了下 demo 没什么问题 想问一下 Form.Item 本身的 那些校验是否都支持? |
Codecov Report
@@ Coverage Diff @@
## feature #26676 +/- ##
===========================================
+ Coverage 99.82% 99.83% +0.01%
===========================================
Files 384 385 +1
Lines 7380 7391 +11
Branches 2062 2014 -48
===========================================
+ Hits 7367 7379 +12
+ Misses 13 12 -1
Continue to review full report at Codecov.
|
@hengkx 只支持自定义校验,Form.List 和 Form.Item 不太一样在于它本身作为字段值一定是数组,但是内部实现又是同一套校验。做注入和 Form.Item 对齐黑了点,所以目前不开放内置的校验方式。 |
是否可以在Form.List加上 min max这些 很常用的 校验 @zombieJ |
嗯,准备先放出来。然后没问题了再加上~ 之后会加的 |
@afc163 The typescript definitions have not been updated. We cannot use rules props with TS files.
|
Form.ErrorList 初始展示报错时,没问题;但是再次展示报错时,会多次渲染,导致dom抖动。官网示例“动态增减表单项”也有这个情况。 |
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
resolve #25717
💡 Background and solution
📝 Changelog
rules
validation and add Form.ErrorList to show the errors.rules
校验并添加 Form.ErrorList 组件用于展示。☑️ Self Check before Merge
View rendered components/form/demo/dynamic-form-item.md
View rendered components/form/index.en-US.md
View rendered components/form/index.zh-CN.md