Skip to content

$$slots is empty object if using customElement: true #6165

Closed
@imsamtar

Description

@imsamtar

When customElement option is set to true $$slots is empty object

here is my use case

<svelte:options tag="my-button" />

<script>
   onMount(() => {
      console.log($$slots);
   });
</script>

{#if $$slots.lefticon}
   <span>
	<slot name="lefticon" />
   </span>
{/if}

<span>
   <slot />
</span>

{#if $$slots.icon}
   <span>
	<slot name="icon" />
   </span>
{/if}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions