Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

input3 根据input1和input2的输入设置value,value可以显示

<TextareaItem
            {...getFieldProps('input1')}
            title="input1"
            placeholder="input1"
          />
          <TextareaItem
            {...getFieldProps('input2')}
            title="input2"
            placeholder="input2"
          />
          <TextareaItem
            {...getFieldProps('input3')}
            editable={false}
            title="input3"
            placeholder=""
            value={`${getFieldValue('input1') || ''} ${getFieldValue('input2') || ''}`}
          />

最后打印表单的值,显示input3的值是undefined的。

 this.props.form.validateFields((error, values) => {

              console.log('ok', values);
          });

图片描述

图片描述


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
590 views
Welcome To Ask or Share your Answers For Others

1 Answer

我这边无法复现,实测没问题。

如果有可以复现的demo,去 github 提个 issue 吧


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...