样式:
在这里插入图片描述
关键代码:

          <Select
                  options={contractOption}
                  allowClear
                  showSearch
                  optionFilterProp="children"
                  //关键代码
                  filterOption={(input, option: any) =>
                    option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
                  }
                  dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}   //控制下拉框下拉弹窗的样式
                  onChange={(value, option: any) => {
                    searchForm.setFieldsValue({
                      'contractName': option?.label
                    })
                    console.log(value, option);
                  }}
                >
          </Select>

样式:
在这里插入图片描述
关键代码:

                        <TreeSelect
                            treeDataSimpleMode
                            placeholder="请选择"
                            treeNodeFilterProp='title'   //关键代码
                            value={valueId}
                            allowClear
                            style={{ width: '500px', marginLeft: '30px' }}
                            labelInValue
                            onChange={onChangeId}
                            treeData={treeSelData}
                            showSearch/>
Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐