• Ant Design使用了getFieldDecorator正确的使用姿势


     Select类型:
    {getFieldDecorator('sceneCategoryId', {
                      rules: [{ required: true, message: '请选择场景类型' }],
                      initialValue: sceneCategoryId
                    })(
                      <Select style={{  '100%' }} onChange={this.typeSelect} placeholder='请选择场景类型'
                        className='selectStyle'
                        dropdownClassName='mySelect'>
                        {this.state.selectData.map((item, i) => {
                          return (<Option key={item.SCENE_CATEGORY_ID} value={item.SCENE_CATEGORY_ID}>{item.SCENE_CATEGORY_NAME}</Option>)
                        })}
                      </Select>
                    )}
     
    Input类型:
    {getFieldDecorator('sceneName', {
                      rules: [{ required: true, message: '请输入场景名称' },
                      {
                        whitespace: true,
                        message: '不能输入空格',
                      }
                        // ,
                        // {
                        //   validator: this.validateToSceneName
                        // }
                      ],
                      initialValue: sceneName
                    })(<Input onChange={this.sceneNameChange} placeholder='请输入场景名称' />)}
    Textarea类型和Input类型一样
          
     {getFieldDecorator('sceneDsc', {
                      rules: [{ required: true, message: '请输入场景描述' },
                      {
                        whitespace: true,
                        message: '不能输入空格',
                      }
                      ],
                      initialValue: sceneDsc
                    })(<TextArea style={{ height: '100px' }} rows={4} onChange={this.sceneDscChange} placeholder='请输入场景描述' />)}
  • 相关阅读:
    numpy 基础 —— np.linalg
    图像旋转后显示不完全
    opencv ---getRotationMatrix2D函数
    PS1--cannot be loaded because the execution of scripts is disabled on this system
    打开jnlp Faild to validate certificate, the application will not be executed.
    BATCH(BAT批处理命令语法)
    oracle vm virtualbox 如何让虚拟机可以上网
    merge 实现
    Windows batch,echo到文件不成功,只打印出ECHO is on.
    python2.7.6 , setuptools pip install, 报错:UnicodeDecodeError:'ascii' codec can't decode byte
  • 原文地址:https://www.cnblogs.com/snowhite/p/14487602.html
Copyright © 2020-2023  润新知