From 794581e4298e9b77828d3432637dda8d381bf4f6 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Mon, 27 Oct 2025 00:11:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=83=AD=E9=97=A8=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E8=AF=8D=E5=8F=96=E5=8E=BB=E6=8E=89loading=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Community/components/PopularKeywords.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/views/Community/components/PopularKeywords.js b/src/views/Community/components/PopularKeywords.js index b18625aa..06596c88 100644 --- a/src/views/Community/components/PopularKeywords.js +++ b/src/views/Community/components/PopularKeywords.js @@ -1,6 +1,6 @@ // src/views/Community/components/PopularKeywords.js import React, { useState, useEffect } from 'react'; -import { Tag, Space, Spin, Button } from 'antd'; +import { Tag, Space, Button } from 'antd'; import { useNavigate } from 'react-router-dom'; import { RightOutlined } from '@ant-design/icons'; import { logger } from '../../../utils/logger'; @@ -15,12 +15,10 @@ const DOMAIN_PREFIX = process.env.NODE_ENV === 'production' const PopularKeywords = ({ onKeywordClick, keywords: propKeywords }) => { const [keywords, setKeywords] = useState([]); - const [loading, setLoading] = useState(false); const navigate = useNavigate(); // 加载热门概念(涨幅前20) const loadPopularConcepts = async () => { - setLoading(true); try { const response = await fetch(`${API_BASE_URL}/search`, { method: 'POST', @@ -53,8 +51,6 @@ const PopularKeywords = ({ onKeywordClick, keywords: propKeywords }) => { } catch (error) { logger.error('PopularKeywords', 'loadPopularConcepts', error); setKeywords([]); - } finally { - setLoading(false); } }; @@ -118,7 +114,7 @@ const PopularKeywords = ({ onKeywordClick, keywords: propKeywords }) => { }; return ( - + <> {keywords && keywords.length > 0 && (
{
)} -
+ ); };