前端hook项目pc总结笔记-ant design select可以进行搜索功能

GG_lyf

关注

阅读 73

2023-03-13


<Select
value={selectedItems}
// onChange={setSelectedItems}
defaultOpen
mode="multiple"
onChange={onChangeVlaue}
showSearch
open={open}
onDropdownVisibleChange={(visible) => setOpen(true)}
style={{ width: '100%' }}
placeholder="请选择员工"
optionFilterProp="children"
autoFocus
>
{staffList && staffList.map((item: any) => (
<Option value={item.id}>{item.name}</Option>
))}
</Select>

showSearch可以让select具有搜索功能

精彩评论(0)

0 0 举报