diff --git a/app/components/list/List.tsx b/app/components/list/List.tsx index b949fc2..ae0b0ff 100644 --- a/app/components/list/List.tsx +++ b/app/components/list/List.tsx @@ -16,8 +16,14 @@ const NewsItem: React.FC = ({ title = '', time = '', url = '' }) => { onClick={() => url && window.open(url)} className="flex items-center justify-between hover:text-blue-600 cursor-pointer transition duration-300 ease-in-out" > -

{title}

-

{time}

+ {/* 标题部分:左侧 */} +
+
+

{title}

+
+ + {/* 时间部分:右侧 */} +

{time}

); diff --git a/app/components/list/NewsList.tsx b/app/components/list/NewsList.tsx index 46b97e7..e219af9 100644 --- a/app/components/list/NewsList.tsx +++ b/app/components/list/NewsList.tsx @@ -11,10 +11,10 @@ const NewsItem: React.FC = ({ title = '', time = '', url = '' }) => { return (
url && window.open(url)} + onClick={() => url && window.open(url)} // 点击时打开链接 className="flex items-center justify-between hover:text-blue-600 cursor-pointer transition duration-300 ease-in-out" > -

{title}

+

{title}

{time}

@@ -28,34 +28,55 @@ const NewsList: React.FC = () => { const educationNews = mockNewsData.filter((news) => news.type === "教育"); return ( -
-
+
+ {/* 使用 Flexbox 将两个列表放在一行 */} +
{/* 科技新闻 */} -
-
-

科技新闻

-
-
    + + {/* 新闻列表 */} +
      {techNews.map((news) => ( - + ))}
{/* 教育新闻 */} -
-
-

教育新闻

-
-
    + + {/* 新闻列表 */} +
      {educationNews.map((news) => ( - + ))}
diff --git a/app/components/news/body/GrassrootsDynamics.tsx b/app/components/news/body/GrassrootsDynamics.tsx index d8ceb34..3c69570 100644 --- a/app/components/news/body/GrassrootsDynamics.tsx +++ b/app/components/news/body/GrassrootsDynamics.tsx @@ -3,7 +3,7 @@ import List from '@/components/list/List'; export default function GrassrootsDynamics() { return ( -
+
{/* 右边列表 */} -
+