ADD: optimize components

This commit is contained in:
webfussel 2024-05-24 09:30:40 +02:00
parent 3fdc5e6b2a
commit a9986cc763

View file

@ -3,9 +3,9 @@
<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="name" :width="size === 'm' ? 30 : 50" :height="size === 'm' ? 30 : 50" :class="[size]"/>
<img loading="lazy" :src="altText()" :alt="name" :width="size === 'm' ? 30 : 50" :height="size === 'm' ? 30 : 50" :class="[size]"/>
</a>
<img v-else loading="lazy" :width="size === 'm' ? 30 : 50" :height="size === 'm' ? 30 : 50" :src="img" />
<img v-else loading="lazy" :width="size === 'm' ? 30 : 50" :height="size === 'm' ? 30 : 50" :src="img" :alt="altText()"/>
<span class="tip">{{name}}</span>
</div>
</template>
@ -18,7 +18,9 @@ type Props = {
size?: 'm' | 'l'
}
withDefaults(defineProps<Props>(), {
const {name} = withDefaults(defineProps<Props>(), {
size: 'm'
})
const altText = () => `Icon für ${name}`
</script>