From aac18c53f626481166ca0c3434486de798f5726f Mon Sep 17 00:00:00 2001 From: master1lan <278457198@qq.com> Date: Tue, 28 Feb 2023 10:50:10 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20fix(custom):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=A0=8F=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E6=B7=BB=E5=8A=A0=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E8=9B=9E=E8=9D=93=E5=9B=9E=E5=88=B0=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ISSUES CLOSED: #25 #26 --- src/routers/layout/logo/modal.tsx | 81 +++++++++++++------------ src/routers/layout/search/pc/search.tsx | 8 +-- 2 files changed, 46 insertions(+), 43 deletions(-) diff --git a/src/routers/layout/logo/modal.tsx b/src/routers/layout/logo/modal.tsx index 91e51b3..85cc6f3 100644 --- a/src/routers/layout/logo/modal.tsx +++ b/src/routers/layout/logo/modal.tsx @@ -1,4 +1,5 @@ import { Button, Link, Modal, styled } from "@mui/material"; +import { Link as Rlink } from "react-router-dom"; import { FC } from "react"; import styles from "./logo.module.less"; @@ -120,47 +121,49 @@ export const Yituo: FC<{ height: number | string; width: number | string; }> = ({ height, width }) => ( - - 芝士蛞蝓 - + + + 芝士蛞蝓 + + + + - - - - - - - + + + + + ); diff --git a/src/routers/layout/search/pc/search.tsx b/src/routers/layout/search/pc/search.tsx index bbe8cbc..b038992 100644 --- a/src/routers/layout/search/pc/search.tsx +++ b/src/routers/layout/search/pc/search.tsx @@ -8,14 +8,14 @@ import { useNavigate } from "react-router-dom"; import { FC, forwardRef, useRef } from "react"; export default function Search() { const [tag] = useURLParams(["tag"]); - const searchId = `pcSearch`; + const inputRef = useRef(null); const { focused, bind } = useSearchFocus(); const { onFocus, onBlur } = bind; const { searchMode } = useSearchMode(); const navigate = useNavigate(), handlerSubmit = () => { - const value = (document.getElementById(searchId) as HTMLInputElement) - .value; + const value = inputRef.current!.value; + console.log(`current input value ${value}`); navigate(`/search?tag=${value}`); onBlur(); }; @@ -37,12 +37,12 @@ export default function Search() { {searchMode === "搜索tag" && ( <> { if (event.key === "Enter") { handlerSubmit();