Update Switch.tsx

This commit is contained in:
仓鼠 2024-12-31 20:17:06 +08:00 committed by GitHub
parent f92b1771cb
commit ab5d2f356b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -62,7 +62,7 @@ export default function Switch({
w: currentTagElement.offsetWidth, w: currentTagElement.offsetWidth,
}) })
} }
}, [nowTag, allTag]) }, [nowTag])
// 处理选中标签的自动滚动 // 处理选中标签的自动滚动
useEffect(() => { useEffect(() => {
@ -82,7 +82,7 @@ export default function Switch({
behavior: 'smooth' behavior: 'smooth'
}) })
} }
}, [nowTag, allTag]) }, [nowTag])
return ( return (
<div <div