Closed JRJurman closed 2 years ago
This PR enables fragment support in Tram-One.
This enables partial component building without cluttering the DOM, and building components that have slots for direct children.
import { registerHtml, TramOneComponent } from '../../src/tram-one'; const html = registerHtml(); const composite: TramOneComponent = () => { const header = html` <> <h3>Top of Description</h3> </> `; const body = html` <> Some Details </> `; return html` <section> ${header} ${body} </section> `; }; export default composite;
This component results in the following DOM:
<section> <h3>Top of Description</h3> Some Details </section>
Summary
This PR enables fragment support in Tram-One.
This enables partial component building without cluttering the DOM, and building components that have slots for direct children.
This component results in the following DOM:
Checklist