| | |
| | | <div class="my-upload"> |
| | | <div v-if="pictureList.length > 0" class="image-box"> |
| | | <div v-for="image in pictureList" class="image-box-item"> |
| | | <i @click="handleDeletePicture(image)" class="el-icon-delete image-delete-icon"></i> |
| | | <i v-if="isShowUpload" @click="handleDeletePicture(image)" class="el-icon-delete image-delete-icon"></i> |
| | | <el-image :key="image" class="image-content" :src="image" ></el-image> |
| | | </div> |
| | | </div> |
| | | <el-upload |
| | | v-if="isShowUpload" |
| | | :file-list="fileList" |
| | | action="/sccg/file/medias" |
| | | :multiple="multiple" |
| | |
| | | :limit="limit" |
| | | :on-success="handleSuccess" |
| | | :on-error="handleError" |
| | | :list-type="listType" |
| | | :on-remove="handleRemove" |
| | | :list-type="listType" |
| | | :headers="getToken()"> |
| | | <div class="upload-btn"> |
| | | <i class="el-icon-plus"></i> |
| | |
| | | return { Authorization: tokenHead + token } |
| | | } |
| | | }, |
| | | // 移除文件 |
| | | handleRemove(file, fileList){ |
| | | this.$emit('delPictureUrl',{url:file.response.data.url1}); |
| | | }, |
| | | |
| | | handleDeletePicture(imageUrl) { |
| | | this.$emit('delPictureUrl', { url: imageUrl }); |
| | |
| | | pictureList: { |
| | | type: Array, |
| | | default: () => [] |
| | | }, |
| | | isShowUpload: { |
| | | type: Boolean, |
| | | default: () => true |
| | | } |
| | | }, |
| | | } |