日期的回显
- renderForm() {
- const {
- form: { getFieldDecorator },
- chargingscheme:{data},
- } = this.props;
- return (
- <Form onSubmit={this.handleSearch} layout="inline">
- <Row gutter={{ md: 8, lg: 24, xl: 48 }}>
- <Col md={8} sm={24}>
- <FormItem label="开始日期">
- {getFieldDecorator("StartDate",
- {
- rules: [{ required: true, message: "请输入数量!" }],
- // initialValue: moment(new Date()),
- // 日期的回显 后台返回的日期格式为 2020-08-22 00:00:00
- initialValue: moment(data.StartDate),
- }
- )(
- <DatePicker format="YYYY-MM-DD" />
- )}
- </FormItem>
- </Col>
来源: http://www.bubuko.com/infodetail-3653858.html