默认主题切换的bug

This commit is contained in:
tangly1024.com
2024-02-02 11:01:05 +08:00
parent 38e6376f5a
commit 464c3add92

View File

@@ -17,16 +17,22 @@ import useAdjustStyle from '@/hooks/useAdjustStyle'
// 各种扩展插件 这个要阻塞引入
import ExternalPlugins from '@/components/ExternalPlugins'
import { THEME } from '@/blog.config'
import GlobalHead from '@/components/GlobalHead'
import { siteConfig } from '@/lib/config'
import BLOG from '@/blog.config'
/**
* App挂载DOM 入口文件
* @param {*} param0
* @returns
*/
const MyApp = ({ Component, pageProps }) => {
// 一些可能出现 bug 的样式,可以统一放入该钩子进行调整
useAdjustStyle();
const route = useRouter()
const queryParam = useMemo(() => {
return getQueryParam(route.asPath, 'theme') || THEME
return getQueryParam(route.asPath, 'theme') || siteConfig('THEME', BLOG.THEME, pageProps.NOTION_CONFIG)
}, [route])
// 整体布局