fix: 修改全局设置不触发的问题

This commit is contained in:
MTrun
2022-02-21 21:16:44 +08:00
parent b980c79ab4
commit d74fb21c9e
7 changed files with 32 additions and 9 deletions
+18
View File
@@ -1,3 +1,6 @@
import merge from 'lodash/merge'
import pick from 'lodash/pick'
/**
* * ECharts option 统一前置处理
* @param option
@@ -6,3 +9,18 @@ export const echartOptionProfixHandle = (option: any) => {
option['backgroundColor'] = 'rgba(0,0,0,0)'
return option
}
/**
* * 合并 color 和全局配置项
* @param option 配置
* @param themeSetting 设置
* @param excludes 排除元素
* @returns object
*/
export const mergeTheme = <T, U, E extends keyof U> (
option: T,
themeSetting: U,
includes: E[] = []
) => {
return merge(pick(themeSetting, includes), option)
}