|  |  |  | 
|---|
|  |  |  | :close-on-click-modal="false" | 
|---|
|  |  |  | title="上传图片" | 
|---|
|  |  |  | :visible.sync="updateImg" | 
|---|
|  |  |  | width="800px" | 
|---|
|  |  |  | width="1000px" | 
|---|
|  |  |  | class="icon-dialog-wrapper dialong-com-style"> | 
|---|
|  |  |  | <ImageCropper ref="iconShot" v-if="updateImg" :imgSrc="img" > | 
|---|
|  |  |  | </ImageCropper> | 
|---|
|  |  |  | 
|---|
|  |  |  | // 上传图片 | 
|---|
|  |  |  | openUpdateIcon (file, fileList) { | 
|---|
|  |  |  | const isJPG = file.raw.type === 'image/jpeg' || file.raw.type === 'image/png' | 
|---|
|  |  |  | const isLt2M = file.size / 1024 / 1024 < 2 | 
|---|
|  |  |  | const isLt2M = file.size / 1024 / 1024 < 5 | 
|---|
|  |  |  | if (!isJPG) { | 
|---|
|  |  |  | this.$message.error('上传头像图片只能是 JPG/PNG 格式!') | 
|---|
|  |  |  | return false | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (!isLt2M) { | 
|---|
|  |  |  | this.$message.error('上传头像图片大小不能超过 2MB!') | 
|---|
|  |  |  | this.$message.error('上传头像图片大小不能超过 5MB!') | 
|---|
|  |  |  | return false | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 上传成功后将图片地址赋值给裁剪框显示图片 | 
|---|