diff --git a/packages/editor-preset-vision/src/deep-value-parser.ts b/packages/editor-preset-vision/src/deep-value-parser.ts index 227e5da09..e5270264a 100644 --- a/packages/editor-preset-vision/src/deep-value-parser.ts +++ b/packages/editor-preset-vision/src/deep-value-parser.ts @@ -3,11 +3,19 @@ import { isJSSlot, isI18nData, isJSExpression } from '@ali/lowcode-types'; import { isPlainObject } from '@ali/lowcode-utils'; import i18nUtil from './i18n-util'; +function isVariable(obj: any) { + return obj && obj.type === 'variable'; +} + // FIXME: 表达式使用 mock 值,未来live 模式直接使用原始值 export function deepValueParser(obj?: any): any { if (isJSExpression(obj)) { obj = obj.mock; } + // 兼容 ListSetter 中的变量结构 + if (isVariable(obj)) { + obj = obj.value; + } if (!obj) { return obj; } diff --git a/packages/editor-preset-vision/src/editor.ts b/packages/editor-preset-vision/src/editor.ts index a24b57c61..efc0a895e 100644 --- a/packages/editor-preset-vision/src/editor.ts +++ b/packages/editor-preset-vision/src/editor.ts @@ -100,7 +100,7 @@ designer.addPropsReducer((props, node) => { // FIXME! item.name could be 'xxx.xxx' const ov = props[item.name]; const v = item.initial(node as any, getRealValue(ov)); - if (v !== undefined) { + if (!ov && v !== undefined) { if (isVariable(ov)) { newProps[item.name] = { ...ov,