Skip to content

Commit

Permalink
fix: nested component
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBLT committed Jan 9, 2024
1 parent 8637559 commit aac4dc4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/@hec.js/ui/example/nested-component/b.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div>{{ text }}</div>
<div>Hi nested: {{ text }}</div>
4 changes: 3 additions & 1 deletion packages/@hec.js/ui/example/nested-component/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
</head>
<body>

<c-a></c-a>
<c-a text="Peter"></c-a>
<c-a text="Herbert"></c-a>
<c-a text="Paula"></c-a>

</body>
</html>
4 changes: 4 additions & 0 deletions packages/@hec.js/ui/lib/src/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ export function templateByNode(template, props = {}) {
const findExpression = (node) => {
const parentNode = node.parentNode;

if (node.nodeName == '#document-fragment') {
nodeProps.set(node, props);
}

if (node instanceof HTMLElement) {

nodeProps.set(node, props);
Expand Down

0 comments on commit aac4dc4

Please sign in to comment.