summaryrefslogtreecommitdiff
path: root/components/UserAvatar.vue
blob: e75587b9c741a809dc3417343443f6ccfd4e3da6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<template lang="pug">
  div(v-if="data")
    img.h-8.w-8.rounded-full(
      :class="{'h-48 w-48': big}"
      v-if="data.avatar" :src="baseAPI+''+data.avatar" alt="Avatar"
    )
    span.h-8.w-8.rounded-full.bg-gray-100.text-center.pt-1.block(
      :class="{'h-48 w-48': big}"
      v-else
    ) {{ data.username[0] }}
</template>

<script>
export default {
  name: "UserAvatar",
  props: ["data", "big"],
  data() {
    return {
      baseAPI: "",
    };
  },
  created() {
    this.baseAPI = this.$config.api;
  },
};
</script>