diff --git a/app/components/news/body/Culturebg.tsx b/app/components/news/body/Culturebg.tsx index db16033..8645c08 100644 --- a/app/components/news/body/Culturebg.tsx +++ b/app/components/news/body/Culturebg.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import { newsStore } from '@/store/newsStore'; +import { useNewsStore } from '@/store/newsStore'; export default function CultureBgPage() { // 定义logo数据数组,包含16个logo信息 - const {logos} = newsStore(); + const {logos} = useNewsStore(); return ( diff --git a/app/components/news/body/ImageGridSection.tsx b/app/components/news/body/ImageGridSection.tsx index 4c10d9c..6506827 100644 --- a/app/components/news/body/ImageGridSection.tsx +++ b/app/components/news/body/ImageGridSection.tsx @@ -1,5 +1,5 @@ import { CarouselDemo } from '@/components/Carousel'; // 导入轮播图组件 -import { newsStore } from '@/store/newsStore'; +import { useNewsStore } from '@/store/newsStore'; import React from 'react'; @@ -7,7 +7,7 @@ import React from 'react'; // LearnPage 组件定义 const LearnPage = () => { // 新闻列表数据,用于显示在右侧新闻列表区 - const {newsList,booksList} = newsStore(); + const {newsList,booksList} = useNewsStore(); {/* 水平居中 使用背景图片方式展示logo 覆盖 只显示1 外边距 弹性 默认纵向 大屏子元素横向 */ } diff --git a/app/components/news/body/Integrated.tsx b/app/components/news/body/Integrated.tsx index e6e00ad..e4207ed 100644 --- a/app/components/news/body/Integrated.tsx +++ b/app/components/news/body/Integrated.tsx @@ -1,8 +1,8 @@ -import {newsStore }from '@/store/newsStore'; +import {useNewsStore }from '@/store/newsStore'; export default function Integrated() { // 在组件内部调用 zustand hook - const { services } = newsStore(); + const { services } = useNewsStore(); // 将一维服务数组转换为三维数组,分为3列,每列4个服务项 // 结构: [[列1的4项], [列2的4项], [列3的4项]] diff --git a/app/components/news/body/Train.tsx b/app/components/news/body/Train.tsx index 3536687..20530d8 100644 --- a/app/components/news/body/Train.tsx +++ b/app/components/news/body/Train.tsx @@ -1,12 +1,15 @@ import { CarouselDemo } from '@/components/Carousel'; // 导入轮播图组件 import React from 'react'; + interface NewsItem { id: string; content: string; url: string; } + + // LearnPage 组件定义 const Train = () => { // 新闻列表数据,用于显示在右侧新闻列表区 @@ -62,6 +65,7 @@ const Train = () => {