I'm struggling to make the following setup work:
My parent template
<comp>
<a href="#" slot="links">link 1</a>
<a href="#" slot="links">link 2</a>
</comp>
and in my component comp
, the template looks like this:
<ul class="comp">
<li class="comp-item"><slot name="links"></slot></li>
</ul>
Right now, all my anchors are going into that single li
tag (which is expected),
but I want to have multiple li
elements for each named slot I insert, like so:
<ul class="comp">
<li class="comp-item"><a href="#" slot="links">link 1</a></li>
<li class="comp-item"><a href="#" slot="links">link 2</a></li>
</ul>
Is there a way to achieve this without using scoped slots? Since my content is pure HTML, I feel it's unnecessary to wrap static content inside props to render them.
Most Vue UI frameworks seem to require using another custom component for each list item, which seems like overkill for this issue. Is there an alternative approach?