This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Zaimki/components/Avatar.vue

24 lines
634 B
Vue
Raw Normal View History

2020-10-15 15:41:41 -07:00
<template>
2020-12-24 04:00:37 -08:00
<img :src="src || user.avatar || (user.avatarSource === 'gravatar' ? gravatar(user, size) : fallbackAvatar(user, size))" alt="" class="rounded-circle"
2021-11-20 03:51:06 -08:00
:style="`width: ${dsize};height: ${dsize};`"/>
2020-10-15 15:41:41 -07:00
</template>
<script>
2020-12-24 04:00:37 -08:00
import { fallbackAvatar, gravatar } from "../src/helpers";
2020-10-15 15:41:41 -07:00
export default {
props: {
user: { required: true },
2020-11-02 12:12:15 -08:00
src: {},
2020-10-29 15:41:40 -07:00
size: { 'default': 128 },
dsize: { 'default': '6rem' },
2020-10-15 15:41:41 -07:00
},
2020-10-16 14:32:51 -07:00
data() {
return {
2020-12-24 04:00:37 -08:00
fallbackAvatar,
gravatar,
2020-10-16 14:32:51 -07:00
};
2020-10-15 15:41:41 -07:00
},
}
</script>