mirror of
https://github.com/ArthurDanjou/arthome.git
synced 2026-01-14 12:14:33 +01:00
23 lines
378 B
Vue
23 lines
378 B
Vue
<script lang="ts" setup>
|
|
const props = defineProps<{
|
|
src: string | null
|
|
}>()
|
|
|
|
const src = computed(() => {
|
|
if (!props.src) {
|
|
return
|
|
}
|
|
|
|
if (props.src.startsWith('http') || props.src.startsWith('data')) {
|
|
return props.src
|
|
}
|
|
|
|
// Prefix the image path with the images folder
|
|
return `images/${props.src}`
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<UAvatar :src />
|
|
</template>
|