pro-components
pro-components copied to clipboard
👑 [需求] LightSelect 组件希望能支持远程搜索
trafficstars
🔩 ProField ProTable
🥰 需求描述
使用轻量筛选下的 ProFormSelect 没办法实现远程搜索,查看源代码发现
options={
keyword
? options?.filter((o) => {
return (
String(o[labelPropsName])?.toLowerCase()?.includes(keyword) ||
o[valuePropsName]?.toString()?.toLowerCase()?.includes(keyword)
);
})
: options
}
option 会按照keyword自动筛选,这会导致我通过搜索框请求后端接口来改变options的时候,会造成闪烁,先展示前端搜索的结果,然后再展示修改options之后的结果
并且 ProFormSelect 中的 fetchDataOnSearch 在 LightSelect 并没有使用
⛰ 功能需求适用场景
轻量筛选使用 ProFormSelect 的搜索
没人回答的吗?
换了配置了,你可以用 onSearch 来复写本地的办法