Bladeren bron

feat(about): 将顶部导航链接替换为Next.js Link组件

- 导入Next.js Link组件替代原生a标签
- 更新导航项href属性以支持页面内锚点跳转
- 保持原有点击事件处理逻辑不变
- 确保滚动到指定元素的功能正常工作
nahida 7 maanden geleden
bovenliggende
commit
3c78b7c129
3 gewijzigde bestanden met toevoegingen van 4 en 3 verwijderingen
  1. 0 0
      src/app/products/[id]/rich.css
  2. 0 0
      src/app/solutions/[id]/rich.css
  3. 4 3
      src/components/about/TopNav.tsx

File diff suppressed because it is too large
+ 0 - 0
src/app/products/[id]/rich.css


File diff suppressed because it is too large
+ 0 - 0
src/app/solutions/[id]/rich.css


+ 4 - 3
src/components/about/TopNav.tsx

@@ -1,6 +1,7 @@
 'use client'
 'use client'
 import React, {useEffect, useState} from 'react';
 import React, {useEffect, useState} from 'react';
 import Image from "next/image";
 import Image from "next/image";
+import Link from "next/link";
 
 
 function TopNav() {
 function TopNav() {
   const arr = [
   const arr = [
@@ -66,9 +67,9 @@ function TopNav() {
           const isActive = activeId === item.id
           const isActive = activeId === item.id
           const isHover = hoverId === item.id
           const isHover = hoverId === item.id
           return (
           return (
-            <a
+            <Link
               key={idx}
               key={idx}
-              href="#"
+              href={`#${item.id}`}
               onClick={(e) => {
               onClick={(e) => {
                 e.preventDefault()
                 e.preventDefault()
                 document.getElementById(item.id)?.scrollIntoView({
                 document.getElementById(item.id)?.scrollIntoView({
@@ -91,7 +92,7 @@ function TopNav() {
                 className="inline-block mr-1"
                 className="inline-block mr-1"
               />
               />
               {item.name}
               {item.name}
-            </a>
+            </Link>
           )
           )
         })}
         })}
       </div>
       </div>

Some files were not shown because too many files changed in this diff