wf4/components/Technology.vue
2024-05-30 08:52:28 +02:00

24 lines
633 B
Vue

<template>
<div class="Technology flex-col" :class="[size]">
<a v-if="link" :href="link" target="_blank" rel="noopener noreferrer">
<img loading="lazy" :src="img" :alt="altText()" :height="size === 'm' ? 30 : 50" :class="[size]"/>
</a>
<img v-else loading="lazy" :height="size === 'm' ? 30 : 50" :src="img" :alt="altText()"/>
<span class="tip">{{name}}</span>
</div>
</template>
<script setup lang="ts">
type Props = {
img: string
name: string
link?: string
size?: 'm' | 'l'
}
const {name} = withDefaults(defineProps<Props>(), {
size: 'm'
})
const altText = () => `Icon für ${name}`
</script>