fix 打包后无法切换样式模式的问题
This commit is contained in:
1
web-react/.env
Normal file
1
web-react/.env
Normal file
@@ -0,0 +1 @@
|
|||||||
|
GENERATE_SOURCEMAP=false
|
||||||
@@ -4,3 +4,8 @@
|
|||||||
body {
|
body {
|
||||||
line-height: 1.42857143;
|
line-height: 1.42857143;
|
||||||
}
|
}
|
||||||
|
#root {
|
||||||
|
transition: @animation-duration-slow opacity;
|
||||||
|
|
||||||
|
opacity: 1 !important;
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,3 +4,8 @@
|
|||||||
body {
|
body {
|
||||||
line-height: 1.42857143;
|
line-height: 1.42857143;
|
||||||
}
|
}
|
||||||
|
#root {
|
||||||
|
transition: @animation-duration-slow opacity;
|
||||||
|
|
||||||
|
opacity: 1 !important;
|
||||||
|
}
|
||||||
|
|||||||
@@ -15,15 +15,18 @@ const SETTING = JSON.parse(window.localStorage.getItem(SETTING_KEY)) || {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (SETTING.theme === 'dark') {
|
if (SETTING.theme === 'dark') {
|
||||||
require('./assets/style/dark/index.less')
|
import('./assets/style/dark/index.less')
|
||||||
} else {
|
} else {
|
||||||
require('./assets/style/default/index.less')
|
import('./assets/style/default/index.less')
|
||||||
}
|
}
|
||||||
|
|
||||||
moment.locale('zh-cn')
|
moment.locale('zh-cn')
|
||||||
|
|
||||||
//<React.StrictMode></React.StrictMode>
|
//<React.StrictMode></React.StrictMode>
|
||||||
|
|
||||||
|
const root = document.getElementById('root')
|
||||||
|
root.style.opacity = 0
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<ConfigProvider
|
<ConfigProvider
|
||||||
locale={zhCN}
|
locale={zhCN}
|
||||||
@@ -38,7 +41,7 @@ ReactDOM.render(
|
|||||||
>
|
>
|
||||||
<Router />
|
<Router />
|
||||||
</ConfigProvider>,
|
</ConfigProvider>,
|
||||||
document.getElementById('root')
|
root
|
||||||
);
|
);
|
||||||
|
|
||||||
// If you want to start measuring performance in your app, pass a function
|
// If you want to start measuring performance in your app, pass a function
|
||||||
|
|||||||
Reference in New Issue
Block a user