| | |
| | | <div> |
| | | <el-upload |
| | | class="avatar-uploader" |
| | | accept=".png,.jpg" |
| | | :action="uploadImgUrl" |
| | | :data="uploadData" |
| | | :show-file-list="false" |
| | |
| | | :on-error="uploadError" |
| | | :before-upload="beforeAvatarUpload"> |
| | | <template v-if="file.imgurlfull"> |
| | | <img :src="file.imgurlfull" class="avatar"> |
| | | <img :src="file.imgurlfull" class="avatar"> |
| | | </template> |
| | | |
| | | <i v-else class="el-icon-plus avatar-uploader-icon"></i> |
| | | |
| | | </el-upload> |
| | | </div> |
| | | |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | imgurlfull: '' |
| | | } |
| | | }, |
| | | |
| | | |
| | | methods: { |
| | | // 上传图片 |
| | | handleAvatarSuccess(res, file) { |
| | |
| | | // // 拦截 |
| | | beforeAvatarUpload(file) { |
| | | this.$emit('uploadBegin') |
| | | return true; |
| | | }, |
| | | }, |
| | | return true |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |