本文示例分享了vue+elementUI图片上传的具体代码供大家参考elementui上传案例,具体内容如下
1.html
2. 定义
dialogImageUrl: '', imgDialogVisible: false, fileLists: [],
3、在需要使用的方法中给出fileLists[]参数
vm.fileLists = []; if (row.logo != undefined && row.logo != "") { vm.fileLists.push({url:row.logo}); }
4.其他几个属性的方式
//删除图片 handleRemove(file, fileList) { this.form.logo='' }, //查看大图 handlePictureCardPreview(file) { this.dialogImageUrl = file.url; this.imgDialogVisible = true; }, //图片上传成功 success(response, file, fileList) { this.fileLists = []; this.fileLists = [file] this.form.logo = file.response.result; },
5、图片上传的位置和路径存储在不同的表中。
以上就是本文的全部内容。 希望对您的学习有所帮助elementui上传案例,也希望您多多支持喊话教程。