fix: 修复style不支持css variable问题 (#8827)

* fix: 修复style不支持css variable问题

* 添加注释

---------

Co-authored-by: qinhaoyan <30946345+qinhaoyan@users.noreply.github.com>
This commit is contained in:
qkiroc 2023-11-21 14:33:04 +08:00 committed by GitHub
parent 7beb05a2fe
commit 3e651e9910
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,7 +46,8 @@ export function buildStyle(style: any, data: any) {
styleVar.radius['bottom-left-border-radius'];
delete styleVar['radius'];
}
if (key.indexOf('-') !== -1) {
// 将属性短横线命名转换为驼峰命名如background-color => backgroundColor。但不处理css variable如--colors-brand-5
if (key.indexOf('-') > 0) {
styleVar[camelCase(valueMap[key] || key)] = styleVar[key];
delete styleVar[key];
}