修复: 解决 webpack-theme-color-replacer 导致的IE 兼容性问题;

master
iczer 5 years ago
parent a90fa8d106
commit 6530ce5a35
  1. 6
      src/utils/themeUtil.js

@ -1,4 +1,4 @@
const ThemeColorReplacer = require('webpack-theme-color-replacer') const varyColor = require('webpack-theme-color-replacer/client/varyColor')
const client = require('webpack-theme-color-replacer/client') const client = require('webpack-theme-color-replacer/client')
const generate = require('@ant-design/colors/lib/generate').default const generate = require('@ant-design/colors/lib/generate').default
const themeColor = require('../config').themeColor const themeColor = require('../config').themeColor
@ -7,10 +7,10 @@ module.exports = {
primaryColor: themeColor, primaryColor: themeColor,
getThemeColors(color) { getThemeColors(color) {
const lightens = new Array(9).fill().map((t, i) => { const lightens = new Array(9).fill().map((t, i) => {
return ThemeColorReplacer.varyColor.lighten(color, i / 10) return varyColor.lighten(color, i / 10)
}) })
const palettes = generate(color) const palettes = generate(color)
const rgb = ThemeColorReplacer.varyColor.toNum3(color.replace('#', '')).join(',') const rgb = varyColor.toNum3(color.replace('#', '')).join(',')
return palettes.concat(lightens).concat(rgb) return palettes.concat(lightens).concat(rgb)
}, },
changeThemeColor (newColor) { changeThemeColor (newColor) {

Loading…
Cancel
Save