ADD: Calendar links

This commit is contained in:
webfussel 2024-05-21 14:29:49 +02:00
parent 55cc380b2b
commit 8395825aea
4 changed files with 23 additions and 6 deletions

View file

@ -1,15 +1,29 @@
<style scoped src="./Button.css"/>
<template>
<button :label="label" class="Button">
<component :is="type" v-bind="actualProps()" class="Button">
{{ label }}
</button>
</component>
</template>
<script setup lang="ts">
type Props = {
type ?: 'a' | 'button'
href ?: string
label : string
}
defineProps<Props>()
const props = withDefaults(defineProps<Props>(), {
type : 'a'
})
const actualProps = () => {
if (props.type === 'a') {
return {
href: props.href,
target: props.href!.startsWith('https://') ? '_blank' : undefined,
}
}
}
</script>