mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
fix: compatiable bug
This commit is contained in:
parent
4d0e29e90a
commit
45574db76c
@ -399,7 +399,7 @@ export function upgradePropConfig(config: OldPropConfig, collector: ConfigCollec
|
||||
},
|
||||
},
|
||||
];
|
||||
if (allowTextInput !== false) {
|
||||
if (allowTextInput) {
|
||||
setters.unshift('I18nSetter');
|
||||
}
|
||||
if (supportVariable) {
|
||||
|
||||
@ -102,6 +102,32 @@ function upgradePropsReducer(props: any) {
|
||||
// 升级 Props
|
||||
designer.addPropsReducer(upgradePropsReducer, TransformStage.Init);
|
||||
|
||||
function compatiableReducer(props: any) {
|
||||
if (!isPlainObject(props)) {
|
||||
return props;
|
||||
}
|
||||
const newProps: any = {};
|
||||
Object.entries<any>(props).forEach(([key, val]) => {
|
||||
if (isJSSlot(val)) {
|
||||
val.value
|
||||
val = {
|
||||
type: 'JSBlock',
|
||||
value: {
|
||||
componentName: 'Slot',
|
||||
children: val.value,
|
||||
props: {
|
||||
slotTitle: val.title,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
newProps[key] = val;
|
||||
});
|
||||
return newProps;
|
||||
}
|
||||
// Dirty fix: will remove this reducer
|
||||
designer.addPropsReducer(compatiableReducer, TransformStage.Save);
|
||||
|
||||
// 设计器组件样式处理
|
||||
function stylePropsReducer(props: any, node: any) {
|
||||
if (props && typeof props === 'object' && props.__style__) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user