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="" />