File tree Expand file tree Collapse file tree 4 files changed +7
-23
lines changed Expand file tree Collapse file tree 4 files changed +7
-23
lines changed Original file line number Diff line number Diff line change @@ -195,10 +195,7 @@ export default {
195
195
setTimeout (() => {
196
196
vm .visible = false
197
197
}, 16 )
198
- // 当主题色不是默认色时,才进行主题编译
199
- if (this .primaryColor !== config .primaryColor ) {
200
- updateTheme (this .primaryColor )
201
- }
198
+ updateTheme (this .primaryColor )
202
199
if (this .colorWeak !== config .colorWeak ) {
203
200
updateColorWeak (this .colorWeak )
204
201
}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import client from 'webpack-theme-color-replacer/client'
2
2
import generate from '@ant-design/colors/lib/generate'
3
3
4
4
export default {
5
- primaryColor : '#1890ff' ,
5
+ primaryColor : '#1890ff' , // TODO 需要处理的暗坑
6
6
getAntdSerials ( color ) {
7
7
// 淡化(即less的tint)
8
8
const lightens = new Array ( 9 ) . fill ( ) . map ( ( t , i ) => {
@@ -15,7 +15,7 @@ export default {
15
15
changeColor ( newColor ) {
16
16
var lastColor = this . lastColor || this . primaryColor
17
17
var options = {
18
- cssUrl : '/css/theme-colors.css' ,
18
+ cssUrl : '/css/theme-colors.css' , // TODO 需要处理的暗坑
19
19
oldColors : this . getAntdSerials ( lastColor ) , // current colors array. The same as `matchColors`
20
20
newColors : this . getAntdSerials ( newColor ) // new colors array, one-to-one corresponde with `oldColors`
21
21
}
Original file line number Diff line number Diff line change 1
1
/**
2
2
* 项目默认配置项
3
- * primaryColor - 默认主题色
3
+ * primaryColor - 默认主题色, 如果修改颜色不生效,请清理 localStorage
4
4
* navTheme - sidebar theme ['dark', 'light'] 两种主题
5
5
* colorWeak - 色盲模式
6
6
* layout - 整体布局方式 ['sidemenu', 'topmenu'] 两种布局
14
14
*/
15
15
16
16
export default {
17
- primaryColor : '#1890FF ' , // primary color of ant design
17
+ primaryColor : '#52C41A ' , // primary color of ant design
18
18
navTheme : 'dark' , // theme for nav menu
19
19
layout : 'sidemenu' , // nav menu position: sidemenu or topmenu
20
20
contentWidth : 'Fixed' , // layout of content: Fluid or Fixed, only works when layout is topmenu
Original file line number Diff line number Diff line change @@ -9,27 +9,14 @@ function resolve (dir) {
9
9
10
10
// vue.config.js
11
11
module . exports = {
12
- /*
13
- Vue-cli3:
14
- Crashed when using Webpack `import()` #2463
15
- https://github.com/vuejs/vue-cli/issues/2463
16
-
17
- */
18
- /*
19
- pages: {
20
- index: {
21
- entry: 'src/main.js',
22
- chunks: ['chunk-vendors', 'chunk-common', 'index']
23
- }
24
- },
25
- */
26
12
configureWebpack : {
27
13
plugins : [
28
14
// Ignore all locale files of moment.js
29
15
new webpack . IgnorePlugin ( / ^ \. \/ l o c a l e $ / , / m o m e n t $ / ) ,
30
16
// 生成仅包含颜色的替换样式(主题色等)
17
+ // TODO 需要增加根据环境不开启主题需求
31
18
new ThemeColorReplacer ( {
32
- fileName : 'css/theme-colors[hash] .css' ,
19
+ fileName : 'css/theme-colors.css' , // TODO 需要处理的暗坑
33
20
matchColors : getAntdSerials ( '#1890ff' ) , // 主色系列
34
21
// 改变样式选择器,解决样式覆盖问题
35
22
changeSelector ( selector ) {
You can’t perform that action at this time.
0 commit comments