我在做一个用户更改头像的功能。如何回显用户已有的头像?response{
"id": 42,
"username": "ttmothy",
"password": "pbkdf2_sha256$150000$kn0tq90w9ilD$Z+1kMKbmB+TJ7lf5XfZHFWMaJzI/GIKH+/jv+L0TOG0=",
"email": "timshen191@gmail.com",
"profile": {
"id": 36,
"gender": "female",
"birthday": "2020-05-07",
"icon": "http://127.0.0.1:8000/media/media/image/2020/05/Hong_Se_deizu_16_magaretutokomitukusuDIGITAL_-_Shui_Ye_Mei_Bo.jpg",
"role": "Reader"
}}我现在想将profile.icon的这张图回显在el-upload里面<el-form-item label="Avatar">
<el-upload
class="avatar-uploader"
action="cdn"
:file-list="user_info.profile.icon" //用户头像
list-type="picture-card"
:limit="1"
>
<i class="el-icon-plus avatar-uploader-icon"/>
</el-upload>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</el-form-item>jsgetUser() {
getUserDetail(this.getUserId).then((response) => {
console.log(response.data);
this.user_info = response.data;
})
},谢谢
添加回答
举报
0/150
提交
取消