Skip to content

Commit

Permalink
Merge pull request #196 from cferdinandi/ianroberts-domparser-template
Browse files Browse the repository at this point in the history
Ianroberts domparser template
  • Loading branch information
cferdinandi authored Nov 2, 2023
2 parents 302130e + 3c1854c commit ca459f0
Show file tree
Hide file tree
Showing 15 changed files with 127 additions and 58 deletions.
73 changes: 73 additions & 0 deletions demos/fragments.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Fragments</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<style type="text/css">
body {
margin: 0 auto;
max-width: 40em;
width: 88%;
}

table {
border-collapse: collapse;
border-spacing: 0;
margin-bottom: 1.5em;
max-width: 100%;
width: 100%;
}

th,
td {
text-align: left;
padding: 0.5em;
}

th {
border-bottom: 0.125em solid #e5e5e5;
font-weight: bold;
vertical-align: bottom;
}

td {
border-top: 1px solid #e5e5e5;
vertical-align: top;
}
</style>
</head>
<body>

<table>
<thead>
<tr>
<th>Number</th>
<th>Wizard</th>
</tr>
</thead>
<tbody id="app"></tbody>
</table>

<script src="../dist/reef.js"></script>
<script>
let {render} = reef;

let wizards = ['Gandalf', 'Ursula', 'Merlin'];

function template () {
return wizards.map(function (wizard, index) {
return `
<tr>
<td>${index + 1}</td>
<td>${wizard}</td>
</tr>`;
}).join('');
}

reef.component('#app', template);
</script>

</body>
</html>
21 changes: 10 additions & 11 deletions dist/reef.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/reef.cjs.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/reef.cjs.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/reef.cjs.min.js.map

Large diffs are not rendered by default.

21 changes: 10 additions & 11 deletions dist/reef.es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/reef.es.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit ca459f0

Please sign in to comment.