diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index bd508bb..ca2bc51 100755 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -20,6 +20,8 @@ import { useConfigStore } from '@/stores'; import { Other, Theme, Web } from '@/types/app/config'; const Header = () => { + const patchName = usePathname(); + // 是否暗黑模式 const { isDark, setIsDark, setWeb, theme, setTheme, setOther } = useConfigStore(); @@ -41,7 +43,6 @@ const Header = () => { setOther(other); }; - const patchName = usePathname(); // 这些路径段不需要改变导航样式 const isPathSty = ['/my', '/wall', '/record', '/equipment', '/tags', '/resume', '/album', '/fishpond'].some((path) => patchName.includes(path)); // 是否改变导航样式 @@ -137,10 +138,9 @@ const Header = () => { {/* 渲染导航 */} {one.type === 'nav' && ( -