mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-02-28 04:40:32 +00:00
fix: try get settingfield
This commit is contained in:
parent
487f257bef
commit
56f242fee9
@ -294,6 +294,9 @@ export class SettingPropEntry implements SettingEntry {
|
|||||||
isUseVariable() {
|
isUseVariable() {
|
||||||
return isJSExpression(this.getValue());
|
return isJSExpression(this.getValue());
|
||||||
}
|
}
|
||||||
|
get useVariable() {
|
||||||
|
return this.isUseVariable();
|
||||||
|
}
|
||||||
getMockOrValue() {
|
getMockOrValue() {
|
||||||
const v = this.getValue();
|
const v = this.getValue();
|
||||||
if (isJSExpression(v)) {
|
if (isJSExpression(v)) {
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { EventEmitter } from 'events';
|
|||||||
import { CustomView, isCustomView, IEditor } from '@ali/lowcode-types';
|
import { CustomView, isCustomView, IEditor } from '@ali/lowcode-types';
|
||||||
import { computed } from '@ali/lowcode-editor-core';
|
import { computed } from '@ali/lowcode-editor-core';
|
||||||
import { SettingEntry } from './setting-entry';
|
import { SettingEntry } from './setting-entry';
|
||||||
import { SettingField } from './setting-field';
|
import { SettingField, isSettingField } from './setting-field';
|
||||||
import { SettingPropEntry } from './setting-prop-entry';
|
import { SettingPropEntry } from './setting-prop-entry';
|
||||||
import { Node } from '../../document';
|
import { Node } from '../../document';
|
||||||
import { ComponentMeta } from '../../component-meta';
|
import { ComponentMeta } from '../../component-meta';
|
||||||
@ -124,7 +124,14 @@ export class SettingTopEntry implements SettingEntry {
|
|||||||
* 获取子项
|
* 获取子项
|
||||||
*/
|
*/
|
||||||
get(propName: string | number): SettingPropEntry {
|
get(propName: string | number): SettingPropEntry {
|
||||||
return new SettingPropEntry(this, propName);
|
const matched = this.items.find(item => {
|
||||||
|
if (isSettingField(item)) {
|
||||||
|
// TODO: thinkof use name or path?
|
||||||
|
return item.name === propName;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}) as SettingPropEntry;
|
||||||
|
return matched || (new SettingPropEntry(this, propName));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user