|
@@ -10,7 +10,10 @@
|
|
|
:accept="accept"
|
|
|
:auto-upload="true"
|
|
|
:on-success="success"
|
|
|
+ :on-remove="handleRemove"
|
|
|
:file-list="fileList"
|
|
|
+ :on-change="handleChange"
|
|
|
+ :class="{hidden:!showUpload}"
|
|
|
>
|
|
|
<i class="el-icon-plus" />
|
|
|
</el-upload>
|
|
@@ -35,7 +38,8 @@ export default {
|
|
|
dialogVisible: false,
|
|
|
// 文件上传请求接口
|
|
|
action: process.env.VUE_APP_UPLOAD_API + '/upload/image',
|
|
|
- accept: '.jpg,.png,.gif'
|
|
|
+ accept: '.jpg,.png,.gif',
|
|
|
+ showUpload: true
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -59,6 +63,17 @@ export default {
|
|
|
this.$message.warning('文件上传大小超出限制(≤1MB)')
|
|
|
return false
|
|
|
}
|
|
|
+ },
|
|
|
+ handleChange(file, fileList) {
|
|
|
+ console.log(fileList)
|
|
|
+ if (fileList === 0) {
|
|
|
+ this.showUpload = true
|
|
|
+ } else {
|
|
|
+ this.showUpload = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleRemove(file, fileList) {
|
|
|
+ this.showUpload = true
|
|
|
}
|
|
|
}
|
|
|
}
|