mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 14:56:07 +08:00
添加全局主题className
This commit is contained in:
parent
0baf0d23ae
commit
1cc54b5da6
|
@ -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={
|
||||||
<>
|
<>
|
||||||
控制面板
|
控制面板
|
||||||
|
|
Loading…
Reference in New Issue
Block a user