JSFiddle - React, Tailwind, and code Playground
by gianlucaguarini
HTML
<script src="https://cdn.jsdelivr.net/riot/3.0/riot+compiler.min.js"></script>
<ok></ok>
<ng></ng>
<script type="riot/tag">
<ok>
<dashboard each={item in items} if={store.selected == item.id} item={item}/>
this.store = {selected: "one"}
this.items = [
{id: "one"},
{id: "two"}
];
</ok>
<ng>
<dashboard each={item in items} show={parent.store.selected == item.id} item={item}/>
this.store = {selected: "uno"}
this.items = [
{id: "uno"},
{id: "due"}
];
</ng>
<dashboard>
<h1>{item.id}</h1>
this.item = opts.item;
</dashboard>
</script>
JavaScript
riot.mount('*');