mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-19 05:48:17 +00:00
feat: live 模式取消 mock 兼容
This commit is contained in:
parent
26f4fb132e
commit
ab66fd4ca5
@ -9,16 +9,23 @@ function isVariable(obj: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: 表达式使用 mock 值,未来live 模式直接使用原始值
|
// FIXME: 表达式使用 mock 值,未来live 模式直接使用原始值
|
||||||
|
// TODO: designType
|
||||||
export function deepValueParser(obj?: any): any {
|
export function deepValueParser(obj?: any): any {
|
||||||
// live
|
if (isJSExpression(obj)) {
|
||||||
if (editor.get('designMode') === 'live') {
|
if (editor.get('designMode') === 'live') {
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
if (isJSExpression(obj)) {
|
|
||||||
obj = obj.mock;
|
obj = obj.mock;
|
||||||
}
|
}
|
||||||
// 兼容 ListSetter 中的变量结构
|
// 兼容 ListSetter 中的变量结构
|
||||||
if (isVariable(obj)) {
|
if (isVariable(obj)) {
|
||||||
|
if (editor.get('designMode') === 'live'){
|
||||||
|
return {
|
||||||
|
type: 'JSExpression',
|
||||||
|
value: obj.variable,
|
||||||
|
mock: obj.value,
|
||||||
|
};
|
||||||
|
}
|
||||||
obj = obj.value;
|
obj = obj.value;
|
||||||
}
|
}
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user