antd 时间选择RangePicker回显,编辑修改 react

 这个需要给form设置接收值。

 const { getFieldProps } = this.props.form
 const { createdTime, deadline} = this.state

    <FormItem label="起止时间:" {...layoutForm}>
              <RangePicker
                onChange={this.onChange}
                style={{ width: 360 }}
                {...getFieldProps('date', {
                  initialValue: [createdTime, deadline]
                })}
              />
    </FormItem>

不用form表单的时候, 也可以设置value,进行默认时间选择,以及修改。

<RangePicker
   style={{ width: 272 }}
   value={queryParams.range}
   onChange={this.handleChangeRange}
 />


版权声明:本文为weixin_47247635原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。