Ant Design 的label中文字换行的替代方式

时间:2025-01-18 22:01:55

const FormItem=;

替换代码

<Row>
                                    <div className={}>
                                      {}
                                    </div>
                                    <div className={}>
                                      <FormItem className='desc'>
                                        {getFieldDecorator(`check_is_do_${}`, {
                                          rules: [
                                            {
                                              required: true,
                                              message: "请选择"
                                            }
                                          ]
                                        })(
                                          <RadioGroup>
                                            <Radio value="1">是</Radio>
                                            <Radio value="0">否</Radio>
                                          </RadioGroup>
                                        )}
                                      </FormItem>
                                    </div>
                                  </Row>

替换样式

.label{
        padding:10px 0px;
        width:510px;
        word-wrap: break-word;
        margin-right:20px;
        &::before {
          display: inline-block;
          margin-right: 4px;
          color: #f5222d;
          font-size: 14px;
          font-family: SimSun, sans-serif;
          line-height: 1;
          content: '*';
        }
      }

原代码

<Row>
<FormItem label={} className='desc'>
                                        {getFieldDecorator(`check_is_do_${}`, {
                                          rules: [
                                            {
                                              required: true,
                                              message: "请选择"
                                            }
                                          ]
                                        })(
                                          <RadioGroup>
                                            <Radio value="1">是</Radio>
                                            <Radio value="0">否</Radio>
                                          </RadioGroup>
                                        )}
                                      </FormItem>
</Row>