From 7fbeca06bbab10ec43e87610c473a8a73feff2c3 Mon Sep 17 00:00:00 2001 From: jinsir <874871581@qq.com> Date: Tue, 18 Nov 2025 16:20:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/list/NewsList.tsx | 59 +++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 17 deletions(-) diff --git a/app/components/list/NewsList.tsx b/app/components/list/NewsList.tsx index 6e3f68c..bdc5959 100644 --- a/app/components/list/NewsList.tsx +++ b/app/components/list/NewsList.tsx @@ -2,21 +2,22 @@ import React from 'react'; import { mockNewsData } from './NewsData'; // 导入新闻数据 interface NewsProps { - title?: string; - description?: string; - time?: string; + title?: string; + description?: string; + time?: string; type?: string; url?: string; } const NewsItem: React.FC = ({ title = '', time = '', url = '' }) => { return ( -
-
url && window.open(url)} - className="flex items-center justify-between hover:text-blue-500 - cursor-pointer w-96"> -

{title}

-

{time}

+
+
url && window.open(url)} + className="flex items-center justify-between hover:text-blue-600 cursor-pointer transition duration-300 ease-in-out" + > +

{title}

+

{time}

); @@ -25,16 +26,40 @@ const NewsItem: React.FC = ({ title = '', time = '', url = '' }) => { // 使用新闻数据渲染列表 const NewsList: React.FC = () => { return ( -
-
    - {mockNewsData.map((news) => ( - - ))} -
+
+
+ {/* 科技新闻 */} +
+
+

科技新闻

+ +
+
    + {mockNewsData.map((news, index) => ( + + ))} +
+
+ + {/* 社会新闻 */} +
+
+

社会新闻

+ +
+
    + {mockNewsData.map((news, index) => ( + + ))} +
+
+
); }; - - export default NewsList; \ No newline at end of file