mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
feat(UIShell): export ref for all UIShell components
This commit is contained in:
parent
4204a10a3e
commit
d1e9fc7225
11 changed files with 82 additions and 5 deletions
|
@ -36,6 +36,12 @@
|
|||
*/
|
||||
export let platformName = undefined;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the HTML button element
|
||||
* @type {null | HTMLButtonElement} [ref=null]
|
||||
*/
|
||||
export let ref = null;
|
||||
|
||||
import HamburgerMenu from "../SideNav/HamburgerMenu.svelte";
|
||||
|
||||
let winWidth = undefined;
|
||||
|
@ -53,7 +59,13 @@
|
|||
{#if winWidth < 1056}
|
||||
<HamburgerMenu bind:isOpen="{isSideNavOpen}" />
|
||||
{/if}
|
||||
<a href="{href}" class:bx--header__name="{true}" {...$$restProps} on:click>
|
||||
<a
|
||||
href="{href}"
|
||||
class:bx--header__name="{true}"
|
||||
bind:this="{ref}"
|
||||
{...$$restProps}
|
||||
on:click
|
||||
>
|
||||
{#if company}
|
||||
<span class:bx--header__name--prefix="{true}">{company} </span>
|
||||
{/if}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue