mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-30 07:18:13 +00:00
feat: add flag createIfNode for ShellNode#getProp
This commit is contained in:
parent
8e5fcd1d59
commit
152a24d655
@ -330,8 +330,8 @@ export default class Node {
|
|||||||
* @param path 属性路径,支持 a / a.b / a.0 等格式
|
* @param path 属性路径,支持 a / a.b / a.0 等格式
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
getProp(path: string): Prop | null {
|
getProp(path: string, createIfNone = true): Prop | null {
|
||||||
return Prop.create(this[nodeSymbol].getProp(path));
|
return Prop.create(this[nodeSymbol].getProp(path, createIfNone));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -340,7 +340,7 @@ export default class Node {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
getPropValue(path: string) {
|
getPropValue(path: string) {
|
||||||
return this.getProp(path)?.getValue();
|
return this.getProp(path, false)?.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user