mirror of
https://github.com/iczer/vue-antd-admin.git
synced 2025-04-06 03:57:44 +08:00
18 lines
494 B
JavaScript
18 lines
494 B
JavaScript
import client from 'webpack-theme-color-replacer/client'
|
|
import generate from '@ant-design/colors/lib/generate'
|
|
|
|
export default {
|
|
primaryColor: '#1890ff',
|
|
changeThemeColor (newColor) {
|
|
let lastColor = this.lastColor || this.primaryColor
|
|
let options = {
|
|
cssUrl: '/css/theme-colors.css',
|
|
oldColors: generate(lastColor),
|
|
newColors: generate(newColor)
|
|
}
|
|
let promise = client.changer.changeColor(options)
|
|
this.lastColor = lastColor
|
|
return promise
|
|
}
|
|
}
|