2
0
mirror of https://github.com/frappe/books.git synced 2025-02-11 08:28:47 +00:00
books/src/components/Avatar.vue

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
685 B
Vue
Raw Normal View History

<template>
<div class="rounded-full overflow-hidden" :class="sizeClasses">
2019-12-21 21:19:01 +05:30
<img
v-if="imageURL"
:src="imageURL"
class="object-cover"
:class="sizeClasses"
/>
<div
v-else
class="bg-gray-500 flex h-full items-center justify-center text-white w-full text-base uppercase"
>
{{ label && label[0] }}
</div>
</div>
</template>
<script>
export default {
name: 'Avatar',
props: {
imageURL: String,
label: String,
size: {
default: 'md'
}
},
computed: {
sizeClasses() {
return {
sm: 'w-5 h-5',
md: 'w-7 h-7',
lg: 'w-9 h-9'
}[this.size];
}
}
};
</script>