我在做一個(gè)用戶更改頭像的功能。如何回顯用戶已有的頭像?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"
????}}我現(xiàn)在想將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;
??})
},謝謝
添加回答
舉報(bào)
0/150
提交
取消