mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-07 10:57:19 +00:00
fix: 去掉将 JSSlot 降级到 JSBlock 的功能, 以便解决预览和出码时无法处理 JSBlock 的问题
This commit is contained in:
parent
45a2c21ab0
commit
024db057ac
@ -12,7 +12,7 @@ import { Skeleton, SettingsPrimaryPane, registerDefaults } from '@ali/lowcode-ed
|
|||||||
import { deepValueParser } from './deep-value-parser';
|
import { deepValueParser } from './deep-value-parser';
|
||||||
import { liveEditingRule, liveEditingSaveHander } from './vc-live-editing';
|
import { liveEditingRule, liveEditingSaveHander } from './vc-live-editing';
|
||||||
import {
|
import {
|
||||||
compatibleReducer,
|
// compatibleReducer,
|
||||||
upgradePageLifeCyclesReducer,
|
upgradePageLifeCyclesReducer,
|
||||||
stylePropsReducer,
|
stylePropsReducer,
|
||||||
upgradePropsReducer,
|
upgradePropsReducer,
|
||||||
@ -55,7 +55,8 @@ designer.addPropsReducer(filterReducer, TransformStage.Save);
|
|||||||
designer.addPropsReducer(filterReducer, TransformStage.Render);
|
designer.addPropsReducer(filterReducer, TransformStage.Render);
|
||||||
|
|
||||||
// FIXME: Dirty fix, will remove this reducer
|
// FIXME: Dirty fix, will remove this reducer
|
||||||
designer.addPropsReducer(compatibleReducer, TransformStage.Save);
|
// designer.addPropsReducer(compatibleReducer, TransformStage.Save);
|
||||||
|
|
||||||
// 兼容历史版本的 Page 组件
|
// 兼容历史版本的 Page 组件
|
||||||
designer.addPropsReducer(upgradePageLifeCyclesReducer, TransformStage.Save);
|
designer.addPropsReducer(upgradePageLifeCyclesReducer, TransformStage.Save);
|
||||||
|
|
||||||
|
|||||||
@ -1,26 +1,26 @@
|
|||||||
import {
|
// import { isPlainObject } from '@ali/lowcode-utils';
|
||||||
isPlainObject,
|
// import { isJSExpression, isJSSlot } from '@ali/lowcode-types';
|
||||||
} from '@ali/lowcode-utils';
|
|
||||||
import { isJSExpression, isJSSlot } from '@ali/lowcode-types';
|
|
||||||
|
|
||||||
export function compatibleReducer(props: any) {
|
export function compatibleReducer(props: any) {
|
||||||
if (!props || !isPlainObject(props)) {
|
|
||||||
return props;
|
return props;
|
||||||
}
|
// if (!props || !isPlainObject(props)) {
|
||||||
// 为了能降级到老版本,建议在后期版本去掉以下代码
|
// return props;
|
||||||
if (isJSSlot(props)) {
|
// }
|
||||||
return {
|
|
||||||
type: 'JSBlock',
|
// // 为了能降级到老版本,建议在后期版本去掉以下代码
|
||||||
value: {
|
// if (isJSSlot(props)) {
|
||||||
componentName: 'Slot',
|
// return {
|
||||||
children: props.value,
|
// type: 'JSBlock',
|
||||||
props: {
|
// value: {
|
||||||
slotTitle: props.title,
|
// componentName: 'Slot',
|
||||||
slotName: props.name,
|
// children: props.value,
|
||||||
},
|
// props: {
|
||||||
},
|
// slotTitle: props.title,
|
||||||
};
|
// slotName: props.name,
|
||||||
}
|
// },
|
||||||
|
// },
|
||||||
|
// };
|
||||||
|
// }
|
||||||
// if (isJSExpression(props) && !props.events) {
|
// if (isJSExpression(props) && !props.events) {
|
||||||
// return {
|
// return {
|
||||||
// type: 'variable',
|
// type: 'variable',
|
||||||
@ -28,9 +28,9 @@ export function compatibleReducer(props: any) {
|
|||||||
// variable: props.value,
|
// variable: props.value,
|
||||||
// };
|
// };
|
||||||
// }
|
// }
|
||||||
const newProps: any = {};
|
// const newProps: any = {};
|
||||||
Object.entries<any>(props).forEach(([key, val]) => {
|
// Object.entries<any>(props).forEach(([key, val]) => {
|
||||||
newProps[key] = compatibleReducer(val);
|
// newProps[key] = compatibleReducer(val);
|
||||||
});
|
// });
|
||||||
return newProps;
|
// return newProps;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user