1

Say I'd like to have a component that wraps its contents (aka children):

<article>
  <header>${input.heading}</header>
  <section> ... contents come here ... </section>
<article>

Then use it like:

...
<my-article heading='Test'>
  Lorem ipsum <s>dolor</s> sit amet
</my-article>

How do I access the contents in the template?

P Varga
  • 19,174
  • 12
  • 70
  • 108

2 Answers2

1

Found the solution - <include> reusable/nested content:

<article>
  <header>${input.heading}</header>
  <section><include(input.body) /></section>
</article>

Then use it like:

<my-article heading='Hello'>
  <@body>Lorem ipsum dolor sit <u>amet</u></@body>
</my-article>
P Varga
  • 19,174
  • 12
  • 70
  • 108
1

Or a simple solution:

<article>
  <header>${input.heading}</header>
  <section><include(input) /></section>
<article>

And use:

   <my-article heading='Test'>
      Lorem ipsum <s>dolor</s> sit amet
   </my-article>
Jessé Pinheiro
  • 303
  • 1
  • 3
  • 10