GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add flag createIfNode for ShellNode#getProp · ikvm/lowcode-engine@152a24d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/shell/src
    • node.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/shell/src/node.ts‎

Copy file name to clipboardExpand all lines: packages/shell/src/node.ts
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ export default class Node {
330330
* @param path 属性路径,支持 a / a.b / a.0 等格式
331331
* @returns
332332
*/
333-
getProp(path: string): Prop | null {
334-
return Prop.create(this[nodeSymbol].getProp(path));
333+
getProp(path: string, createIfNone = true): Prop | null {
334+
return Prop.create(this[nodeSymbol].getProp(path, createIfNone));
335335
}
336336

337337
/**
@@ -340,7 +340,7 @@ export default class Node {
340340
* @returns
341341
*/
342342
getPropValue(path: string) {
343-
return this.getProp(path)?.getValue();
343+
return this.getProp(path, false)?.getValue();
344344
}
345345

346346
/**

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.