1
0
Fork 0
mirror of synced 2024-09-09 22:16:26 +12:00
budibase/packages/standard-components/src/Link.svelte

23 lines
452 B
Svelte
Raw Normal View History

2020-02-21 06:06:50 +13:00
<script>
2020-02-26 04:21:23 +13:00
import { cssVars, createClasses } from "./cssVars"
export let url = ""
export let text = ""
export let openInNewTab = false
export let _bb
let anchorElement
$: anchorElement && !text && _bb.attachChildren(anchorElement)
$: target = openInNewTab ? "_blank" : "_self"
2020-02-21 06:06:50 +13:00
</script>
<a href={url} bind:this={anchorElement} {target}>{text}</a>
2020-02-22 00:43:21 +13:00
<style>
2020-02-26 04:21:23 +13:00
.textDecoration {
text-decoration: var(--textDecoration);
}
2020-02-22 00:43:21 +13:00
</style>