mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
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:
parent
db5e273170
commit
6ef0f0640c
1 changed files with 10 additions and 2 deletions
|
@ -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}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue