fix: 预加载行业数据(解决第一次点击无数据问题)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user