# search-menu LLMs.txt > 供 LLM 快速理解 `@flatbiz/antd/search-menu` 的使用方式。 ## 模块定位 列表搜索 ## 导入方式 ```ts import { SearchMenu } from '@flatbiz/antd/search-menu'; // 也可以从主入口导入:import { ... } from '@flatbiz/antd'; ``` ## 公开导出 - `* from ./search-menu.jsx` - `ListView` - 搜索列表 - `IListViewProps` - `SearchMenu` - 列表搜索 - `ISearchMenuProps` - `IListViewItem` ## 依赖的 antd 能力 `Empty` ## Props / 配置要点 ### IListViewProps - `dataList`(必填):: IListViewItem[] - `value`(可选):: string - `onChange`(可选):: (key: string, item: IListViewItem) => void - `style`(可选):: CSSProperties - `emptyView`(可选):: ReactElement;自定义空数据提示 ### ISearchMenuProps - `size`(可选):: 'small' | 'default' - `value`(可选):: string;如果传了value,就变成受控组件 目前只支持单选 - `onChange`(可选):: (key: string, targetItem?: TPlainObject) => void - `dataSource`(必填):: TPlainObject[];树型源数据 - `lazySearch`(可选):: boolean;惰性搜索 - `searchKeyList`(可选):: string[];搜索目标字段 - `fieldNames`(可选):: { label?: string; key?: string; };格式化参数 - `renderItem`(可选):: (nodeData: TPlainObject) => ReactElement;自定义渲染条目 - `inputProps`(可选):: InputSearchWrapperProps;搜索框参数 - `searchExtraElement`(可选):: ReactElement;搜索位置额外元素 - `placeholder`(可选):: string - `className`(可选):: string - `wrapStyle`(可选):: CSSProperties - `style`(可选):: CSSProperties - `searchStyle`(可选):: CSSProperties - `searchAutoFocus`(可选):: boolean;搜索框自动聚焦 - `showSearch`(可选):: boolean;是否显示搜索区域 ### IListViewItem - `label`(必填):: ReactNode - `key`(必填):: string ## 使用规则与行为 - 自定义空数据提示 - 搜索列表 @param props @returns search menu list view - 列表搜索 @param props @returns - 格式化对象 - 可搜索的字段值 - 生成菜单列表 - 数据格式化 - 搜索 - 搜索词变换 @param e - 点击条目 ## 基础示例 ```tsx import { SearchMenu, type IListViewProps } from '@flatbiz/antd/search-menu'; const props: IListViewProps = { // 按业务传入必要参数 }; ; ``` ## 源码索引 - `src/search-menu/index.ts` - `src/search-menu/list-view/index.tsx` - `src/search-menu/search-menu.tsx` - `src/search-menu/type.ts` ## 给 LLM 的注意事项 - 优先使用 `@flatbiz/antd/search-menu` 或主入口 `@flatbiz/antd` 的公开导出,不要引用内部实现文件。 - 当 Props 与 antd 原组件同名能力冲突时,以本模块导出的 Props 类型为准。 - 若文档未覆盖某个边缘参数,请读取上方源码索引中的类型定义和 JSDoc。