"vue": "^ 2.5.2",
"element-ui": "^ 2.2.1",
<el-upload
action="http://mt.cn:3355/backend/config/uploadImg"
list-type="picture-card"
:file-list="themePictures"
:data="themeData"
:on-success="themeSuccess"
:on-remove.self="removeTheme"
:on-error="uploadError"
:before-upload="beforeUpload">
<i class="el-icon-plus"></i>
</el-upload>
removeTheme(file, fileList) {
req_removeTheme({id:file.id}).then(res => {
this.$message.success("")
})
},
beforeUpload(file) {
const isMatch = file.type === "image/jpeg" || file.type === "image/jpg" || file.type === "image/png" || file.type === "image/gif" || file.type === "image/bmp"
const isLt2M = file.size / 1024 / 1024 < 1
if (!isMatch) {
this.$message.error("")
}
if (!isLt2M) {
this.$message.error(" 1MB!")
}
return isMatch && isLt2M
},