Support PrefixNameContext in Form
See original GitHub issueWhat 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?
<PrefixContext.Provider value={["application", "container"]}>
<PrefixContext.Provider value={["lifecycle"]}>
<Form.Item name="postStart">
{/* 实际name:["application", "container", "lifecycle", "postStart" ] */}
</Form.Item>
<Form.Item name="preStop">
{/* 实际name:["application", "container", "lifecycle", "preStop" ] */}
</Form.Item>
</PrefixContext.Provider>
<PrefixContext.Provider value={["metadata", "annotations"]}>
<Form.Item name="lbcinstance">
{/* 实际name:["application", "container", "metadata", "annotations", "lbcinstance" ] */}
</Form.Item>
<Form.Item name="bound">
{/* 实际name:["application", "container", "metadata", "annotations", "bound" ] */}
</Form.Item>
</PrefixContext.Provider>
</PrefixContext.Provider>
Issue Analytics
- State:
- Created 9 months ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
How to create a condition based on the full name prefix value?
I'm trying to display a question in my form based on the name prefix as the question only applies to woman. I have...
Read more >Use a prefix to set the data source context
Resolve the data source using code ; Prefix. code:<full class name> ; Example. code:SXA.POC.DataSources.CodeDataSource,SXA.POC ...
Read more >How to apply form prefix in django template - Stack Overflow
After all, I tried this {{ form1.name_of_term }}. simply made it work like charm. Although i didnt know and i cant explain.
Read more >Available Prefixes and Fields for Configuration
The rules and the available prefixes and elements are outlined below. AddressScreen. Rule, Entity, Supported Prefix Syntax. AddressScreen, None, AddressGUID ...
Read more >Prefix: Definition, Meaning, and Examples - ProWritingAid
As a verb, the basic meaning of prefix is “to place at the beginning.” For example, you might prefix a fancy title to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
mark,我在想这个功能是不是业务同学实现
Context
比较好 ,而非组件库去做这个就是你上面的例子,Context 搞两条路径,一个存要传导的,一个存全量的。只要分割清楚就好了哈~