-
-
Notifications
You must be signed in to change notification settings - Fork 50.6k
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
Support PrefixNameContext in Form #39564
Comments
You may look for issues: |
目前 |
感觉有点裸,需要讨论一下。 |
mark,我在想这个功能是不是业务同学实现 |
API 添加会比较慎重,和几个 Collaborator 聊了一下。感觉可以先做个 Demo 出来,让开发者进行封装。 |
业务自行实现的问题在于 |
@zombieJ 麻烦确认一下这个demo。 |
嗯,看起来 List 需要其他方式封装。 |
业务上在 目前业务上的实现是:https://codesandbox.io/s/prefixnamecontext-demo-forked-kw8rub?file=/demo.tsx 虽然能实现,但是觉得为了避免和 感觉如果能够原生暴露出来会很方便 |
这样很清晰👍 不过业务上还有一个需求🤣。因为字段嵌套层级太深,如果字段之间有依赖关系时目前是使用相对路径的。 |
这个就是你上面的例子,Context 搞两条路径,一个存要传导的,一个存全量的。只要分割清楚就好了哈~ |
What problem does this feature solve?
业务中使用Form组件开发大型表单。比如用来创建K8s资源对象(Application等)有大量字段和多层嵌套层级。比如:
application.container.lifecycle.postStart.exec.command
application.container.lifecycle.preStop.exec.command
application.container.metadata.annotations.lbcinstance
application.container.metadata.annotations.bound
...
手动配置每个Form.Item的name字段会有大量重复的prefix,比如:
['application', 'xxx1']
,['application', 'xxx2']
,['application', 'xxx3']
...(同一级最多可能10-20个字段)
What does the proposed API look like?
The text was updated successfully, but these errors were encountered: