fix: the problem that changing the theme color does not work because of cache reasons :star2:
修复: 缓存原因导致主题色更换不生效的问题;
| | |
| | | changeThemeColor (newColor) { |
| | | let lastColor = this.lastColor || this.primaryColor |
| | | let options = { |
| | | cssUrl: '/css/theme-colors.css', |
| | | changeUrl (cssUrl) { |
| | | return `/${cssUrl}` // while router is not `hash` mode, it needs absolute path |
| | | }, |
| | | oldColors: this.getThemeColors(lastColor), |
| | | newColors: this.getThemeColors(newColor) |
| | | } |
| | |
| | | config.entry.app = ["babel-polyfill", "whatwg-fetch", "./src/main.js"]; |
| | | config.plugins.push( |
| | | new ThemeColorReplacer({ |
| | | fileName: 'css/theme-colors.css', |
| | | fileName: 'css/theme-colors-[contenthash:8].css', |
| | | matchColors: getThemeColors(themeColor), |
| | | changeSelector |
| | | }) |