Skip to content

Latest commit

 

History

History
50 lines (41 loc) · 599 Bytes

README.md

File metadata and controls

50 lines (41 loc) · 599 Bytes

p6-react

use Component;
use Slang;

component Item {
    has Str $.data;
    method render {
        <li>
            {{$.data}}
        </li>
    }
}

component UlList {
    has Str @.items;
    method render {
        <ul>
            {{
                do for @.items -> $item {
                    <Item data={{$item}} />
                }
            }}
        </ul>
    }
}

say UlList.new(:items<bla ble bli>).render.render

running:

<ul>
     <li>
          bla
     </li>

     <li>
          ble
     </li>

     <li>
          bli
     </li>

</ul>