修复前端缺少 @ctrl/tinycolor 依赖库,以及不兼容4.1.x版本的问题

This commit is contained in:
helix.song 2024-04-23 18:29:54 +08:00 committed by wanghe-fit2cloud
parent ecb44bc1e7
commit e87f5b07cd
2 changed files with 3 additions and 2 deletions

View File

@ -13,6 +13,7 @@
"format": "prettier --write src/"
},
"dependencies": {
"@ctrl/tinycolor": "^4.1.0",
"axios": "^0.28.0",
"cropperjs": "^1.6.2",
"echarts": "^5.5.0",

View File

@ -5,7 +5,7 @@ import type {
UpdateInferData,
UpdateKeyValueData
} from './type'
import tinycolor from '@ctrl/tinycolor'
import { TinyColor } from '@ctrl/tinycolor'
// 引入默认推断数据
import inferData from './defaultInferData'
// 引入默认keyValue数据
@ -119,7 +119,7 @@ class Theme {
l.toString()
)
return {
[varName]: tinycolor(inferData.value)
[varName]: new TinyColor(inferData.value)
.mix(key === 'light' ? this.colorWhite : this.colorBlack, l * 10)
.toHexString()
}