Antd all selected example, why can't the getFieldDecorator method of form get the selected value value?

clipboard.png

clipboard.png

Jun.24,2022

well, it's not complicated

  <FormItem label="Cb">
          {form.getFieldDecorator("cbType")(
            <CheckboxGroup
              options={["Apple", "Pear", "Orange"]}
            />
          )}
  </FormItem>

get the form instance ref
and then get the value of the form through the getFieldsValue () method


1. Have you wrapped it with < FormItem >?
2. Form.create () (< component / >) for components;
3, this.props.form.getFieldsValue (function (values, err) {if (! err) {console.log (values)}})

Menu