From cf6d539d59d555caf4a4129aa4cb1f3f1fb6ed13 Mon Sep 17 00:00:00 2001 From: xixi <123@qq.com> Date: Thu, 18 Jul 2024 14:49:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=83=8C=E6=99=AF=E8=89=B2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/route/index/Index.tsx | 25 ++++++++++++++----------- src/route/proj/proj-edit.css | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/route/index/Index.tsx b/src/route/index/Index.tsx index 0ee14f5..b42233f 100644 --- a/src/route/index/Index.tsx +++ b/src/route/index/Index.tsx @@ -227,7 +227,7 @@ export default function Index() { setShowSearchBox(false) // setNewname(location.pathname) - setPathArray([{ title: 首页 }, { title: '编辑项目' }]) + setPathArray([{ title: 首页 }, { title: '编辑项目' }]) } else if (location.pathname.includes('/proj-eall')) { setNow('编辑项目') setShowSearchBox(false) @@ -330,13 +330,16 @@ export default function Index() { }, []); useEffect(() => { - console.log('监听type',type); - nav('/home', { - state: { - keyword: keywords, - name: type - } - }) + console.log('监听type', type); + if (location.pathname.includes('/home')) { + nav('/home', { + state: { + keyword: keywords, + name: type + } + }) + } + }, [type]); const handleSearch = (value: string) => { @@ -349,9 +352,9 @@ export default function Index() { } }) } - const handleChange = (e:any) => { + const handleChange = (e: any) => { console.log(e.target.value); - if(e.target.value == ''){ + if (e.target.value == '') { setKeywords('') nav('/home', { state: { @@ -449,7 +452,7 @@ export default function Index() { { value: 'MATERIAL', label: '写材料' }, { value: 'ALL', label: '全托管' }, ]} - defaultValue="" + defaultValue="" />