Skip to content

Commit

Permalink
make improvements of the syntax for query node by name
Browse files Browse the repository at this point in the history
  • Loading branch information
xieguigang committed Mar 21, 2024
1 parent ae39ec1 commit 054cd78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions LINQ.ts/DOM/DOMQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace DOM {
* + ``#`` by id
* + ``.`` by class
* + ``!`` by name
* + ``$`` by name(alias)
* + ``&`` SINGLE NODE
* + ``@`` read meta tag
* + ``<>`` create new tag
Expand Down Expand Up @@ -117,6 +118,7 @@ namespace DOM {
case "#": return this.getById(expr.substr(1));
case ".": return this.getByClass(expr.substr(1), isSingle);
case "!": return this.getByName(expr.substr(1), isSingle);
case "$": return this.getByName(expr.substr(1), isSingle);
case "<": return this.createElement(expr);
case "@": return this.queryMeta(expr.substr(1));

Expand Down
6 changes: 6 additions & 0 deletions LINQ.ts/DOM/DOMQueryTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
* ``<tag class="xxx">``
*/
class = 10,
/**
* 表达式为 $xxx
* 按照节点的name属性值进行查询
*
* ``<tag name="xxx">``
*/
name = 100,
/**
* 表达式为 xxx
Expand Down

0 comments on commit 054cd78

Please sign in to comment.