Commit d6ed5d07 authored by GuanHua's avatar GuanHua

feat:新增动态主题开关控制

parent 6c71e37e
......@@ -23,3 +23,5 @@
1. 样式
- 全局样式需写在src/global/global.less下, 涉及到color, size之类的属性尽量变量化 并且储存在/styles/theme.less中
"umi-plugin-antd-theme": "^2.1.2"
\ No newline at end of file
import { defineConfig } from 'umi';
import routes from './router'
import proxy from './proxy'
import theme from './theme.config'
import theme from './lingxi.theme.config'
export default defineConfig({
const OPEN_THEME_BUILD = false // 是否开启动态主题
const config:any = {
title: '瓴犀开放平台',
// layout: {},
antd: {},
......@@ -34,7 +36,7 @@ export default defineConfig({
logLevel: 'info',
defaultSizes: 'parsed', // stat // gzip
},
inlineLimit: 10000,
// 自定义修改webpack配置
chainWebpack(memo, { env, webpack, createCSSRule }) {
},
......@@ -71,5 +73,12 @@ export default defineConfig({
* https://umijs.org/zh-CN/config#theme
* 配置主题,实际上是配 less 变量。
*/
// theme,
});
theme: theme
}
if(OPEN_THEME_BUILD) {
config.plugins = [...config.plugins, 'umi-plugin-antd-theme']
delete config.theme
}
export default defineConfig(config);
......@@ -10,7 +10,7 @@
}
],
"min": true,
"isModule": true,
"isModule": false,
"ignoreAntd": false,
"ignoreProLayout": false,
"cache": true
......
......@@ -50,7 +50,6 @@
"fs-extra": "^9.0.1",
"gulp": "^4.0.2",
"json2ts": "^0.0.7",
"ora": "^4.0.4",
"umi-plugin-antd-theme": "^2.1.2"
"ora": "^4.0.4"
}
}
......@@ -46,28 +46,7 @@ const OuterSider: React.FC<OuterSiderProps> = (props) => {
</li>
))
}
</ul>
{/* <Menu mode="inline" defaultSelectedKeys={['1']}>
<Menu.Item key="1">
通用
</Menu.Item>
<Menu.Item key="2">
渠道
</Menu.Item>
<Menu.Item key="3">
采购
</Menu.Item>
<Menu.Item key="4">
供应
</Menu.Item>
<Menu.Item key="5">
加工
</Menu.Item>
<Menu.Item key="6">
物流
</Menu.Item>
</Menu> */}
</Sider>
</>
}
......
......@@ -25,7 +25,7 @@
}
.wrapperSilder {
background-color: #38414A;
background-color: #38414A!important;
.menuBox {
padding: 0;
......
......@@ -4,7 +4,7 @@
.levelIcon1 {
width : 100%;
height : 16px;
background : url("../../../assets/imgs/level1@2x.png") no-repeat;
background : url("/static/imgs/level1@2x.png") no-repeat;
background-size: 54px 16px;
margin-top : 8px;
}
......@@ -12,7 +12,7 @@
.levelIcon2 {
width : 100%;
height : 16px;
background : url("../../../assets/imgs/level2@2x.png") no-repeat;
background : url("/static/imgs/level2@2x.png") no-repeat;
background-size: 54px 16px;
margin-top : 8px;
}
......@@ -20,7 +20,7 @@
.levelIcon3 {
width : 100%;
height : 16px;
background : url("../../../assets/imgs/level3@2x.png") no-repeat;
background : url("/static/imgs/level3@2x.png") no-repeat;
background-size: 54px 16px;
margin-top : 8px;
}
......
......@@ -61,28 +61,28 @@
.levelIcon1 {
width : 100%;
height : 20px;
background : url("../../../assets/imgs/vip1@2x.png") no-repeat center;
background : url("/static/imgs/vip1@2x.png") no-repeat center;
background-size: 24px 20px;
}
.levelIcon2 {
width : 100%;
height : 20px;
background : url("../../../assets/imgs/vip2@2x.png") no-repeat center;
background : url("/static/imgs/vip2@2x.png") no-repeat center;
background-size: 24px 20px;
}
.levelIcon3 {
width : 100%;
height : 20px;
background : url("../../../assets/imgs/vip3@2x.png") no-repeat center;
background : url("/static/imgs/vip3@2x.png") no-repeat center;
background-size: 24px 20px;
}
.levelIcon4 {
width : 100%;
height : 20px;
background : url("../../../assets/imgs/vip4@2x.png") no-repeat center;
background : url("/static/imgs/vip4@2x.png") no-repeat center;
background-size: 24px 20px;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment