mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
添加全局主题className
This commit is contained in:
+10
-1
@@ -64,6 +64,16 @@ export default function (props: any) {
|
|||||||
}
|
}
|
||||||
}, [props.location.pathname]);
|
}, [props.location.pathname]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (theme && theme.theme) {
|
||||||
|
if (theme.theme === 'vs-dark') {
|
||||||
|
document.body.classList.add('dark');
|
||||||
|
} else {
|
||||||
|
document.body.classList.add('white');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [theme]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const _theme = localStorage.getItem('qinglong_dark_theme') || 'auto';
|
const _theme = localStorage.getItem('qinglong_dark_theme') || 'auto';
|
||||||
setFetchMethod(window.fetch);
|
setFetchMethod(window.fetch);
|
||||||
@@ -92,7 +102,6 @@ export default function (props: any) {
|
|||||||
<ProLayout
|
<ProLayout
|
||||||
selectedKeys={[props.location.pathname]}
|
selectedKeys={[props.location.pathname]}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
className={theme.theme === 'vs-dark' ? 'dark' : 'white'}
|
|
||||||
title={
|
title={
|
||||||
<>
|
<>
|
||||||
控制面板
|
控制面板
|
||||||
|
|||||||
Reference in New Issue
Block a user