Последняя версия с сервера прошлого разработчика
This commit is contained in:
34
resources/js/Shared/Misc/UserAvatar.vue
Executable file
34
resources/js/Shared/Misc/UserAvatar.vue
Executable file
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div
|
||||
v-if="user.photo_path"
|
||||
class="rounded-full bg-cover bg-center"
|
||||
:style="setBackground()"
|
||||
></div>
|
||||
<div
|
||||
v-else
|
||||
:style="`background-color:${user.color};`"
|
||||
class="select-none rounded-full font-bold flex items-center justify-center text-white"
|
||||
>
|
||||
{{ user.user_char }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
user: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: 'small',
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
setBackground() {
|
||||
return `background-image: url(/img/${this.user.photo_path}?p=${this.size});`
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user