主要是要设置:
mode='combobox'
optionLabelProp='children'
<Form onSubmit={this.handleSubmit}>
<FormItem
style={{ marginBottom: 16 }}
label="原因"
>
{getFieldDecorator('reason', {
rules: [{
required: true, message: '请选择替诊原因!',
}],
})(
<Select
style={{ width: '100%' }}
placeholder="请选择替诊原因"
loading={false}
showSearch
filterOption={this.filterOption}
mode='combobox'
optionLabelProp='children'
>
{
this.state.reasonList.map((item, index) => {
return (
<Option key={item}>{item}</Option>
)
})
}
</Select>
)}
</FormItem>
<FormItem style={{ marginBottom: 16 }} >
<Button onClick={hideStopModal}>取消</Button>
<Button type="primary" htmlType="submit" className="login-form-button" style={{ marginLeft: 20 }}>确定</Button>
</FormItem>
</Form>
网友评论