We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e5fcd1 commit 152a24dCopy full SHA for 152a24d
1 file changed
packages/shell/src/node.ts
@@ -330,8 +330,8 @@ export default class Node {
330
* @param path 属性路径,支持 a / a.b / a.0 等格式
331
* @returns
332
*/
333
- getProp(path: string): Prop | null {
334
- return Prop.create(this[nodeSymbol].getProp(path));
+ getProp(path: string, createIfNone = true): Prop | null {
+ return Prop.create(this[nodeSymbol].getProp(path, createIfNone));
335
}
336
337
/**
@@ -340,7 +340,7 @@ export default class Node {
340
341
342
getPropValue(path: string) {
343
- return this.getProp(path)?.getValue();
+ return this.getProp(path, false)?.getValue();
344
345
346
0 commit comments