File tree Expand file tree Collapse file tree 3 files changed +7
-10
lines changed
src/components/SettingDrawer Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 5757 "opencollective-postinstall" : " ^2.0.2" ,
5858 "vue-svg-icon-loader" : " ^2.1.1" ,
5959 "vue-template-compiler" : " ^2.5.22" ,
60- "webpack-theme-color-replacer" : " ^1.1.5 "
60+ "webpack-theme-color-replacer" : " ^1.2.15 "
6161 },
6262 "eslintConfig" : {
6363 "root" : true ,
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import client from 'webpack-theme-color-replacer/client'
22import generate from '@ant-design/colors/lib/generate'
33
44export default {
5- primaryColor : '#1890ff' , // TODO 需要处理的暗坑
65 getAntdSerials ( color ) {
76 // 淡化(即less的tint)
87 const lightens = new Array ( 9 ) . fill ( ) . map ( ( t , i ) => {
@@ -13,14 +12,12 @@ export default {
1312 return lightens . concat ( colorPalettes )
1413 } ,
1514 changeColor ( newColor ) {
16- var lastColor = this . lastColor || this . primaryColor
1715 var options = {
18- cssUrl : '/css/theme-colors.css' , // TODO 需要处理的暗坑
19- oldColors : this . getAntdSerials ( lastColor ) , // current colors array. The same as `matchColors`
20- newColors : this . getAntdSerials ( newColor ) // new colors array, one-to-one corresponde with `oldColors`
16+ newColors : this . getAntdSerials ( newColor ) , // new colors array, one-to-one corresponde with `matchColors`
17+ changeUrl ( cssUrl ) {
18+ return `/${ cssUrl } ` // while router is not `hash` mode, it needs absolute path
19+ }
2120 }
22- var promise = client . changer . changeColor ( options , Promise )
23- this . lastColor = lastColor
24- return promise
21+ return client . changer . changeColor ( options , Promise )
2522 }
2623}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ module.exports = {
1616 // 生成仅包含颜色的替换样式(主题色等)
1717 // TODO 需要增加根据环境不开启主题需求
1818 new ThemeColorReplacer ( {
19- fileName : 'css/theme-colors.css' , // TODO 需要处理的暗坑
19+ fileName : 'css/theme-colors-[contenthash:8] .css' ,
2020 matchColors : getAntdSerials ( '#1890ff' ) , // 主色系列
2121 // 改变样式选择器,解决样式覆盖问题
2222 changeSelector ( selector ) {
You can’t perform that action at this time.
0 commit comments