优化FormItemsRenderer
							parent
							
								
									959859e668
								
							
						
					
					
						commit
						431e3cbc37
					
				|  | @ -297,14 +297,7 @@ const FormItemsRenderer = ({ | |||
|           return ( | ||||
|             option.customizeRender | ||||
|               ? (renderFormControl(option)) | ||||
|               : ( | ||||
|                   <Col key={option.name || index} span={itemSpan} style={style}> | ||||
|                     <Form.Item | ||||
|                       noStyle | ||||
|                       shouldUpdate={option.shouldUpdate ?? option?.componentProps?.shouldUpdate} | ||||
|                       dependencies={option.dependencies || option?.componentProps?.dependencies} | ||||
|                     > | ||||
|                       {() => { | ||||
|               : (() => { | ||||
|                   // 支持动态计算 hidden
 | ||||
|                   const hidden = typeof option.hidden === "function" | ||||
|                     ? option.hidden(getFormValues()) | ||||
|  | @ -313,6 +306,14 @@ const FormItemsRenderer = ({ | |||
|                   if (hidden) | ||||
|                     return null; | ||||
| 
 | ||||
|                   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} | ||||
|  | @ -328,7 +329,8 @@ const FormItemsRenderer = ({ | |||
|                         }} | ||||
|                       </Form.Item> | ||||
|                     </Col> | ||||
|                 ) | ||||
|                   ); | ||||
|                 })() | ||||
|           ); | ||||
|         } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue