ADD: Calendar links
This commit is contained in:
parent
55cc380b2b
commit
8395825aea
4 changed files with 23 additions and 6 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue