优化FormItemsRenderer
							parent
							
								
									04dcbd202f
								
							
						
					
					
						commit
						983ca08106
					
				|  | @ -297,7 +297,14 @@ const FormItemsRenderer = ({ | |||
|           return ( | ||||
|             option.customizeRender | ||||
|               ? (renderFormControl(option)) | ||||
|               : (() => { | ||||
|               : ( | ||||
|                 <Form.Item | ||||
|                   key={option.name || index} | ||||
|                   noStyle | ||||
|                   shouldUpdate={option.shouldUpdate ?? option?.componentProps?.shouldUpdate} | ||||
|                   dependencies={option.dependencies || option?.componentProps?.dependencies} | ||||
|                 > | ||||
|                   {() => { | ||||
|                     // 支持动态计算 hidden
 | ||||
|                     const hidden = typeof option.hidden === "function" | ||||
|                       ? option.hidden(getFormValues()) | ||||
|  | @ -308,13 +315,6 @@ const FormItemsRenderer = ({ | |||
| 
 | ||||
|                     return ( | ||||
|                       <Col key={option.name || index} span={itemSpan} style={style}> | ||||
|                       <Form.Item | ||||
|                         noStyle | ||||
|                         shouldUpdate={option.shouldUpdate ?? option?.componentProps?.shouldUpdate} | ||||
|                         dependencies={option.dependencies || option?.componentProps?.dependencies} | ||||
|                       > | ||||
|                         {() => { | ||||
|                           return ( | ||||
|                         <Form.Item | ||||
|                           name={option.name} | ||||
|                           label={renderLabel(option)} | ||||
|  | @ -325,12 +325,11 @@ const FormItemsRenderer = ({ | |||
|                         > | ||||
|                           {renderFormControl(option)} | ||||
|                         </Form.Item> | ||||
|                       </Col> | ||||
|                     ); | ||||
|                   }} | ||||
|                 </Form.Item> | ||||
|                     </Col> | ||||
|                   ); | ||||
|                 })() | ||||
|               ) | ||||
|           ); | ||||
|         } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue