You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: An unnamed <slot> will be filled with all of the custom element's top-level child nodes that do not have the slot attribute. This includes text nodes.
So this should probably work too:
<x-panel>
<!-- Named Slot -->
<h1 slot="header">Panel Header</h1>
<!-- Default Slot -->
<p>Panel Content</p>
<p> some more content </p>
</x-panel>
The text was updated successfully, but these errors were encountered:
The reason for this is that Alpine might have already rendered the content if there's no template tag. Pulling it out to fill the slot would cause the elements that are generated to be considered part of the template too, leading to duplicate content.
In the case you gave of the static html content, it would actually work as is. The before and after (Alpine) content is the same so, it doesn't matter.
Consider the example from the documentation:
This could be more concisely expressed as:
The Spec says:
So this should probably work too:
The text was updated successfully, but these errors were encountered: