mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:39:05 +08:00
fix: 清除css错误转成key的属性 (#9025)
Co-authored-by: qinhaoyan <30946345+qinhaoyan@users.noreply.github.com>
This commit is contained in:
parent
293e6f6919
commit
f5804b8204
@ -134,6 +134,8 @@ export function JSONPipeIn(
|
||||
if (obj.type) {
|
||||
// 处理下历史style数据,整理到themeCss
|
||||
obj = style2ThemeCss(obj);
|
||||
// 处理下旧数据css被错误转成属性的问题
|
||||
obj = clearDirtyCssKey(obj);
|
||||
|
||||
// 重新生成组件ID
|
||||
if (reGenerateId) {
|
||||
@ -1237,6 +1239,19 @@ export function style2ThemeCss(data: any) {
|
||||
};
|
||||
}
|
||||
|
||||
export function clearDirtyCssKey(data: any) {
|
||||
if (!data?.type) {
|
||||
return data;
|
||||
}
|
||||
const temp = {...data};
|
||||
Object.keys(temp).forEach(key => {
|
||||
if (key.startsWith('.') || key.startsWith('#')) {
|
||||
delete temp[key];
|
||||
}
|
||||
});
|
||||
return temp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从amis数据域中取变量数据
|
||||
* @param node
|
||||
|
Loading…
Reference in New Issue
Block a user