|
@@ -51,18 +51,18 @@ export default {
|
|
return { }
|
|
return { }
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
- customTheme: {
|
|
|
|
|
|
+ 'config.customize': {
|
|
handler () {
|
|
handler () {
|
|
- this.changeStyle(this.config)
|
|
|
|
- }
|
|
|
|
|
|
+ this.changeStyle(this.config, true)
|
|
|
|
+ },
|
|
|
|
+ deep: true
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted () {
|
|
mounted () {
|
|
this.chartInit()
|
|
this.chartInit()
|
|
- // this.changeStyle()
|
|
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- changeStyle (config) {
|
|
|
|
|
|
+ changeStyle (config, isUpdateTheme) {
|
|
config = { ...this.config, ...config }
|
|
config = { ...this.config, ...config }
|
|
const input = document.querySelector(`#el-input-${config.code}`)
|
|
const input = document.querySelector(`#el-input-${config.code}`)
|
|
// const inputIcon = input.querySelector(`.${this.config.customize.icon.name}`)
|
|
// const inputIcon = input.querySelector(`.${this.config.customize.icon.name}`)
|
|
@@ -79,11 +79,13 @@ export default {
|
|
inputIcon.style.fontSize = config.customize.inputStyle.fontSize + 'px'
|
|
inputIcon.style.fontSize = config.customize.inputStyle.fontSize + 'px'
|
|
}
|
|
}
|
|
// 样式改变时更新主题配置
|
|
// 样式改变时更新主题配置
|
|
- config.theme = settingToTheme(_.cloneDeep(config), this.customTheme)
|
|
|
|
- this.changeChartConfig(config)
|
|
|
|
- // if (config.code === this.activeCode) {
|
|
|
|
- // this.changeActiveItemConfig(config)
|
|
|
|
- // }
|
|
|
|
|
|
+ if (!isUpdateTheme) {
|
|
|
|
+ config.theme = settingToTheme(_.cloneDeep(config), this.customTheme)
|
|
|
|
+ this.changeChartConfig(config)
|
|
|
|
+ if (config.code === this.activeCode) {
|
|
|
|
+ this.changeActiveItemConfig(config)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|