These are chat archives for riot/riot

23rd
Jul 2015
Claudio Holanda
@kazzkiq
Jul 23 2015 13:47
Anybody know how can I mount a tag with HTML inside it?
Sơn Trần-Nguyễn
@sntran
Jul 23 2015 13:48
@kazzkiq would using yield work?
Claudio Holanda
@kazzkiq
Jul 23 2015 13:48
like:
<my-tag>
<p>Custom HTML</p>
</my-tag>
Sơn Trần-Nguyễn
@sntran
Jul 23 2015 13:49

In your tag defination, use

<my-tag>
<yield />
</my-tag>

Claudio Holanda
@kazzkiq
Jul 23 2015 13:49
When I try to simply add HTML inside a declared tag, it just don't renders to the page when the tag is mounted
Claudio Holanda
@kazzkiq
Jul 23 2015 19:40
Ok, it was a newbie question and was documented, but if anyone is interested, to add custom HTML to your tag when using it declaratively you can use <yield/> tag

Example:
Your tag:

<my-tag>
    <yield/>
</my-tag>

When declaring it:

<my-tag>
    <h1>My html here, etc..</h1>
    <!-- ... -->
</my-tag>