feat: SearchBar 模糊搜索功能
- SearchBar: 添加股票代码/名称模糊搜索下拉列表 - SearchBar: 使用 Redux allStocks 数据源进行过滤 - SearchBar: 点击外部自动关闭下拉,选择后自动搜索 - useCompanyStock: handleKeyPress 改为 handleKeyDown(兼容性优化) - Company/index: 初始化时加载全部股票列表 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -18,20 +18,20 @@ import SearchBar from './SearchBar';
|
||||
*
|
||||
* 包含:
|
||||
* - 页面标题和描述(金色主题)
|
||||
* - 股票搜索栏
|
||||
* - 股票搜索栏(支持模糊搜索)
|
||||
*
|
||||
* @param {Object} props
|
||||
* @param {string} props.inputCode - 搜索输入框值
|
||||
* @param {Function} props.onInputChange - 输入变化回调
|
||||
* @param {Function} props.onSearch - 搜索回调
|
||||
* @param {Function} props.onKeyPress - 键盘事件回调
|
||||
* @param {Function} props.onKeyDown - 键盘事件回调
|
||||
* @param {string} props.bgColor - 背景颜色
|
||||
*/
|
||||
const CompanyHeader = ({
|
||||
inputCode,
|
||||
onInputChange,
|
||||
onSearch,
|
||||
onKeyPress,
|
||||
onKeyDown,
|
||||
bgColor,
|
||||
}) => {
|
||||
return (
|
||||
@@ -51,7 +51,7 @@ const CompanyHeader = ({
|
||||
inputCode={inputCode}
|
||||
onInputChange={onInputChange}
|
||||
onSearch={onSearch}
|
||||
onKeyPress={onKeyPress}
|
||||
onKeyDown={onKeyDown}
|
||||
/>
|
||||
</HStack>
|
||||
</CardBody>
|
||||
|
||||
Reference in New Issue
Block a user