| | |
| | | :style="customStyle" |
| | | action="" |
| | | :auto-upload="false" |
| | | :before-upload="beforeUpload" |
| | | :show-file-list="false" |
| | | :on-change='openUpdateIcon'> |
| | | <img v-if=" file.imgurlfull" style="width: 100%;" :src="file.imgurlfull" :style="customStyle" class="avatar"> |
| | |
| | | type: String, |
| | | default: 'width: 90px; height: 90px;' |
| | | }, |
| | | size: { |
| | | type: Number, |
| | | default: () => 5 |
| | | }, |
| | | uploadData: Object |
| | | }, |
| | | data () { |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | beforeUpload (file) { |
| | | const isLt2M = file.size / 1024 / 1024 < this.size; |
| | | if (!isLt2M) { |
| | | this.$message.error(`上传图片大小不能超过${this.size}mb!`); |
| | | return false |
| | | } |
| | | return true |
| | | }, |
| | | uploadIcon () { |
| | | // 获取裁剪后的图片 |
| | | this.$refs.iconShot.getImagecropper().getCropBlob((fileData) => { // 获取当前裁剪好的数据 |