riot compiler
by jpeter06
HTML
<template id="my-tag">
<my-tag>
<h1>{ props.titulo }</h1>
<p><slot name="content"/></p>
</my-tag>
</template>
<my-tag titulo="Hello Riot">riot compiler sample</my-tag>
<script src="https://unpkg.com/riot@4/riot+compiler.min.js"></script>
<script>
(async function main() {
const tagString = document.getElementById('my-tag').innerHTML;
const {code} = riot.compileFromString(tagString);
riot.inject(code, 'my-tag', './my-tag.html');
await riot.compile();
riot.mount('my-tag');
}())
</script>