Add external setting for links
This commit is contained in:
parent
80f86720ac
commit
d856bcd35a
|
@ -7,11 +7,19 @@
|
||||||
export let url = ""
|
export let url = ""
|
||||||
export let text = ""
|
export let text = ""
|
||||||
export let openInNewTab = false
|
export let openInNewTab = false
|
||||||
|
export let external = false
|
||||||
|
|
||||||
$: target = openInNewTab ? "_blank" : "_self"
|
$: target = openInNewTab ? "_blank" : "_self"
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
{#if external}
|
||||||
|
<a href={url || '/'} {target} use:styleable={$component.styles}>
|
||||||
|
{text}
|
||||||
|
<slot />
|
||||||
|
</a>
|
||||||
|
{:else}
|
||||||
<a href={url || '/'} use:linkable {target} use:styleable={$component.styles}>
|
<a href={url || '/'} use:linkable {target} use:styleable={$component.styles}>
|
||||||
{text}
|
{text}
|
||||||
<slot />
|
<slot />
|
||||||
</a>
|
</a>
|
||||||
|
{/if}
|
||||||
|
|
Loading…
Reference in New Issue