From 8af476f34926ae46a3fd8a1a1a376d597654a453 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Mon, 4 Mar 2024 14:37:31 +0800 Subject: [PATCH] =?UTF-8?q?algoliamodel=20=E5=AD=97=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/AlgoliaSearchModal.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/components/AlgoliaSearchModal.js b/components/AlgoliaSearchModal.js index 4044f9df..6554e353 100644 --- a/components/AlgoliaSearchModal.js +++ b/components/AlgoliaSearchModal.js @@ -5,7 +5,7 @@ import Link from 'next/link' import { useGlobal } from '@/lib/global' import throttle from 'lodash/throttle' import { siteConfig } from '@/lib/config' -import { useHotkeys } from "react-hotkeys-hook"; +import { useHotkeys } from 'react-hotkeys-hook'; /** * 结合 Algolia 实现的弹出式搜索框 @@ -67,7 +67,6 @@ export default function AlgoliaSearchModal({ cRef }) { if (inputRef.current) inputRef.current.value = '' } - useEffect(() => { if (isModalOpen) { setTimeout(() => { @@ -122,7 +121,7 @@ export default function AlgoliaSearchModal({ cRef }) { search: query, target: { element: 'span', - className: 'text-blue-600 border-b border-dashed' + className: 'font-bold border-b border-dashed' } }) }, 200) // 延时高亮 @@ -211,7 +210,7 @@ export default function AlgoliaSearchModal({ cRef }) {

无法找到相关结果 "{keyword}"

+ >"{keyword}"

) } @@ -220,9 +219,9 @@ export default function AlgoliaSearchModal({ cRef }) {
  • setActiveIndex(index)} onClick={() => onJumpSearchResult(index)} - className={`cursor-pointer replace my-2 p-2 ${activeIndex === index ? 'bg-blue-600 ' : ''}`}> + className={`cursor-pointer replace my-2 p-2 duration-100 ${activeIndex === index ? 'bg-blue-600 ' : ''}`}> {result.title} @@ -309,4 +308,4 @@ function Pagination(props) { })} ) -} \ No newline at end of file +}