Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions www/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,14 @@ title: ///_hyperscript
<code>${}</code> interpolation, and the runtime handles re-rendering via morphing.</p>
<p>Components should be easy. Hyperscript makes them easy.</p>
{% highlight "html" %}
<template component="click-counter"
_="init set ^count to 0">
<script type="text/hyperscript-template" component="click-counter" _="set ^count to 0">

<button _="on click increment ^count">+</button>
<span>Clicks: ${^count}</span>
</template>
<span class="label">Clicks: ${^count}</span>
</script>

<click-counter></click-counter>
<br>
<click-counter></click-counter>
{% endhighlight %}
</div>
Expand Down