Also apply icon slot logic for link buttons

Without this, a button link with an icon prop would not be rendered.
This commit is contained in:
Eric Liu 2024-02-24 14:05:46 -08:00
commit 6ef0f0640c

View file

@ -167,9 +167,17 @@
{/if} {/if}
<slot /> <slot />
{#if $$slots.icon} {#if $$slots.icon}
<svelte:component this="{icon}" {...iconProps} /> <slot
name="icon"
style="{hasIconOnly ? 'margin-left: 0' : undefined}"
{...iconProps}
/>
{:else if icon} {:else if icon}
<slot name="icon" {...iconProps} /> <svelte:component
this="{icon}"
style="{hasIconOnly ? 'margin-left: 0' : undefined}"
{...iconProps}
/>
{/if} {/if}
</a> </a>
{:else} {:else}