You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/packages/svelte/tests/runtime-runes/samples/custom-element-slot-in-snippet/Component.svelte

19 lines
431 B

<script context="module">
if (!customElements.get('my-custom-element')) {
customElements.define('my-custom-element', class extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = '|<slot></slot>|<slot name="slot"></slot>|';
}
});
}
</script>
<script>
const { children } = $props();
</script>
<my-custom-element>
{@render children()}
</my-custom-element>