[users] Fixed avatar on widget
This commit is contained in:
parent
f787e314ef
commit
679d98a2af
|
@ -4,7 +4,7 @@
|
||||||
<div v-if="avatar" class="col-4">
|
<div v-if="avatar" class="col-4">
|
||||||
<div style="width: 100%; padding-bottom: 100%; position: relative">
|
<div style="width: 100%; padding-bottom: 100%; position: relative">
|
||||||
<q-avatar style="position: absolute; top: 0; left: 0; width: 100%; height: 100%">
|
<q-avatar style="position: absolute; top: 0; left: 0; width: 100%; height: 100%">
|
||||||
<q-img :src="avatarLink" @error="avatar = false" />
|
<img :src="avatarLink" :onerror="error" />
|
||||||
</q-avatar>
|
</q-avatar>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -43,6 +43,10 @@ export default defineComponent({
|
||||||
const name = ref(mainStore.currentUser.firstname);
|
const name = ref(mainStore.currentUser.firstname);
|
||||||
const avatarLink = ref(mainStore.currentUser.avatar_url);
|
const avatarLink = ref(mainStore.currentUser.avatar_url);
|
||||||
|
|
||||||
|
function error() {
|
||||||
|
avatar.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
function userHasBirthday(user: FG.User) {
|
function userHasBirthday(user: FG.User) {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
return (
|
return (
|
||||||
|
@ -62,7 +66,7 @@ export default defineComponent({
|
||||||
.filter((user) => user.userid !== mainStore.currentUser.userid)
|
.filter((user) => user.userid !== mainStore.currentUser.userid)
|
||||||
);
|
);
|
||||||
|
|
||||||
return { avatar, avatarLink, name, hasBirthday, birthday };
|
return { avatar, avatarLink, error, name, hasBirthday, birthday };
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue