wf4/components/Button.vue
webfussel cbe1f89ec6 FIX: fix bugs caused by upgrade
Remove with defaults as it is no longer needed, props is removed
2025-01-29 09:28:12 +01:00

29 lines
456 B
Vue

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