feat: 搜索栏交互优化 - 移除查询按钮,选择后直接跳转
- SearchBar: 移除"查询"按钮,简化交互 - SearchBar: 选择股票后直接触发搜索跳转 - useCompanyStock: handleSearch 支持直接传入股票代码参数 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -50,9 +50,10 @@ export const useCompanyStock = (options = {}) => {
|
||||
|
||||
/**
|
||||
* 执行搜索 - 更新 stockCode 和 URL
|
||||
* @param {string} [code] - 可选,直接传入股票代码(用于下拉选择)
|
||||
*/
|
||||
const handleSearch = useCallback(() => {
|
||||
const trimmedCode = inputCode?.trim();
|
||||
const handleSearch = useCallback((code) => {
|
||||
const trimmedCode = code || inputCode?.trim();
|
||||
|
||||
if (trimmedCode && trimmedCode !== stockCode) {
|
||||
// 触发变化回调(用于追踪)
|
||||
|
||||
Reference in New Issue
Block a user