使用 ant design 提供的 getFieldDecorator 进行验证

一般开始使用默认选中

<FormItem>
              {getFieldDecorator('checkProtocol', {
                valuePropName: "checked",
                initialValue: true,
                rules: [{ required: true, message: '请同意,我已经阅读并接受' }],
              })(
                  <CheckboxGroup  defaultValue={'我已经阅读并接受' } options = {
                    [{ 
                      label: '我已经阅读并接受' , 
                      value: '我已经阅读并接受'
                    }]
                  } /> 
              )}
 </FormItem>

相关文章:

  • 2021-05-11
  • 2021-05-18
  • 2021-09-04
  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
  • 2021-07-04
猜你喜欢
  • 2021-05-23
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
  • 2022-01-03
相关资源
相似解决方案