From 3f518def09562903ad606b67040ec9bde1d6f1e4 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Thu, 4 Dec 2025 12:33:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A2=84=E5=8A=A0=E8=BD=BD=E8=A1=8C?= =?UTF-8?q?=E4=B8=9A=E6=95=B0=E6=8D=AE=EF=BC=88=E8=A7=A3=E5=86=B3=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E7=82=B9=E5=87=BB=E6=97=A0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Community/components/CompactSearchBox.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/views/Community/components/CompactSearchBox.js b/src/views/Community/components/CompactSearchBox.js index 1cb9d51a..95dc54c1 100644 --- a/src/views/Community/components/CompactSearchBox.js +++ b/src/views/Community/components/CompactSearchBox.js @@ -93,6 +93,13 @@ const CompactSearchBox = ({ loadStocks(); }, []); + // 预加载行业数据(解决第一次点击无数据问题) + useEffect(() => { + if (!industryData || industryData.length === 0) { + dispatch(fetchIndustryData()); + } + }, [dispatch, industryData]); + // 初始化筛选条件 const findIndustryPath = useCallback((targetCode, data, currentPath = []) => { if (!data || data.length === 0) return null;