首页卡片头像不出现问题

This commit is contained in:
lmj
2022-10-22 14:07:55 +08:00
parent ecf5b2a3d9
commit ef939c53a8
2 changed files with 10 additions and 4 deletions

View File

@@ -1,7 +1,9 @@
<template>
<div class="item-author">
<div :style="`width:${width};height:${height};`" @click="toHome()">
{{userAvatar}}
<el-avatar shape="circle" :src="userAvatar" v-if="userAvatar"></el-avatar>
<div v-else class="uavatar">
<div v-if="sex == null" style="border-radius: 50%;" :style="`width:${width};height:${height};`"></div>
<div v-else>
@@ -52,6 +54,7 @@
},
mounted() {
this.userName=this.name;
this.usersex = this.sex;
if(this.avatar){
if(this.avatar.startsWith('http')){
this.userAvatar=this.avatar;
@@ -59,7 +62,8 @@
this.userAvatar=this.baseUrl+this.avatar;
}
}
this.usersex = this.sex;
console.log(this.usersex)
},
methods:{
toHome() {