ADD: optimize css

This commit is contained in:
webfussel 2024-05-24 09:23:49 +02:00
parent 14866f81f2
commit a59d465a2d
5 changed files with 267 additions and 266 deletions

View file

@ -1,29 +0,0 @@
<style scoped src="./Button.css"/>
<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 props = withDefaults(defineProps<Props>(), {
type : 'a'
})
const actualProps = () => {
if (props.type === 'a') {
return {
href: props.href,
target: props.href!.startsWith('https://') ? '_blank' : undefined,
}
}
}
</script>