问题来源:

是否启用  选是,不更改
是否启用  选否,增加生效时间item

react   antd form Item嵌套问题

 

 

 


react   antd form Item嵌套问题

react   antd form Item嵌套问题

react   antd form Item嵌套问题

 

  const hasEffectiveDate = form.getFieldValue('stationEnabled') == 0

<FormItem label="是否启用" style={{ display: hasEffectiveDate ? 'inline-flex' : 'flex' }}> {getFieldDecorator('stationEnabled', { initialValue: stationDetail.stationEnabled, rules: [{ required: true, message: '请选择是否接入' }] })( <Select style={{ width: hasEffectiveDate ? '63px' : '198px' }} > <Option value={1}>是</Option> <Option value={0}>否</Option> </Select> )} {hasEffectiveDate && <FormItem label="生效时间" style={{ display: 'inline-flex', width: '65%', marginBottom: '0px' }}> {getFieldDecorator('takeEffectTime', { initialValue: stationDetail.effectiveDate || '', rules: [{ required: true, message: '请选择生效时间' }] })( <DatePicker disabledDate={disabledDate} /> )} </FormItem>} </FormItem>

  

 

相关文章:

  • 2022-12-23
  • 2021-11-30
  • 2021-07-16
  • 2022-12-23
  • 2021-06-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-30
  • 2022-12-23
  • 2023-03-20
  • 2022-12-23
  • 2021-10-03
  • 2021-12-06
相关资源
相似解决方案