首页卡片头像不出现问题

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() {

View File

@@ -14,8 +14,10 @@
</swiper>
</div>
<div class="personal-panel">
<div class="personal-img">
<author-img v-if="userInfo.avatar" :avatar="userInfo.avatar" :aid="userInfo.aid" :noJump="false" :sex="userInfo.sex"></author-img>
<div class="personal-img">
<author-img width="68px" height="68px" :avatar="userInfo.avatar" :aid="userInfo.aid" :noJump="false" :sex="userInfo.sex"></author-img>
{{ userInfo.avatar }}
<!-- {{ userInfo.avatar }} -->
</div>
<!-- <img style="width:68px;height:68px" src="/images/Avatarman.png" alt=""> -->
@@ -463,7 +465,7 @@
needHobbyShow:false,//是否显示兴趣爱好
formatNum:formatUserNumber,
cutOrgNamePath:cutOrgNamePath,
//userInfo: {},
// userInfo: {},
ankingList: [],
answersList: [],
Popularity: [],