使用组件,
:size="46" 这是大小
:limit="1" 最多上传文件数
list-type="picture" 上传文件类型
action="" 上传地址
auto-upload 是否自动上传 (填写false后.上传之后自动弹出一个小框)
accept="image/jpeg" 上传文件的类型,上传界面仅显示该类文件
on-change 事件获取文件信息
头像
on-change事件 getFile()函数 -> 检查文件大小及格式 ->
检验通过后将图片转成base64 getbase64()函数 ->
上传更新用户信息到数据库 setUser()函数 -> 图片回显
.PersonalData{ .divs{ display: flex; justify-content: left; height: 60px; border-bottom:1px solid #f0f0f5 ; .title{ line-height: 70px; width: 100px; text-align: left; } .avatar-uploader{ width: 50px; height: 50px; } span{ line-height: 70px; } .avatar{ width: 50px; height: 50px; border-radius: 50%; } } }



