budibase/packages/standard-components/src/Link.svelte

23 lines
469 B
Svelte
Raw Normal View History

2020-02-20 18:06:50 +01:00
<script>
2020-02-25 16:21:23 +01: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-20 18:06:50 +01:00
</script>
<a href={_bb.relativeUrl(url)} bind:this={anchorElement} {target}>{text}</a>
2020-02-21 12:43:21 +01:00
<style>
2020-02-25 16:21:23 +01:00
.textDecoration {
text-decoration: var(--textDecoration);
}
2020-02-21 12:43:21 +01:00
</style>