fix 打包后无法切换样式模式的问题

This commit is contained in:
2021-07-02 12:15:23 +08:00
parent 850d490a1b
commit 0d9e77afc7
4 changed files with 17 additions and 3 deletions

1
web-react/.env Normal file
View File

@@ -0,0 +1 @@
GENERATE_SOURCEMAP=false

View File

@@ -4,3 +4,8 @@
body { body {
line-height: 1.42857143; line-height: 1.42857143;
} }
#root {
transition: @animation-duration-slow opacity;
opacity: 1 !important;
}

View File

@@ -4,3 +4,8 @@
body { body {
line-height: 1.42857143; line-height: 1.42857143;
} }
#root {
transition: @animation-duration-slow opacity;
opacity: 1 !important;
}

View File

@@ -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