<el-upload
v-model="imgs5"
action="https://jsonplaceholder.typicode.com/posts/"
list-type="picture-card"
:on-remove="removeHandle5"
:on-change="changeHandle5"
auto-upload="false"
:file-list="listA5"
:limit="1"
>
<i slot="default" class="el-icon-plus"></i>
</el-upload>
data部分
imgs5: "",
listA5: [],
listAbc5: [],
methods部分
//图片上传服务器
async changeHandle5 (file, a) {
this.listAbc5 = file
this.showflile5 = true
let formDataImg = new FormData();
formDataImg.append("file", this.listAbc5.raw);
const { data: res } = await this.$http.merchants.UploadFilemendian(formDataImg)
console.log(res.Data);
this.imgs5 = res.Data
this.listAbc5 = [{}]
},
//删除图片
removeHandle5 (file, a) {
this.imgs5 = ''
},
//编辑回显
this.imgs5 = this.huis.storelogo
this.listA5 = [{ name: "", url: this.huis.storelogo }];