liucf 5 gadi atpakaļ
vecāks
revīzija
49273a3280
1 mainītis faili ar 3 papildinājumiem un 2 dzēšanām
  1. 3 2
      src/common/UploadImg.vue

+ 3 - 2
src/common/UploadImg.vue

@@ -67,7 +67,7 @@ export default {
     addImg() {
       // 上传图片进行压缩,压缩后超过4M则不允许上传
       let fileTag = this.$refs.inp;
-      let img = this.$refs.img;
+      // let img = this.$refs.img;
       let file = fileTag.files[0];
       const that = this;
       this.imgBase64(file, function (image, canvas) {
@@ -97,7 +97,8 @@ export default {
           that.$store.commit('setImgSrc', { key: key, src: uploadSrc, type: that.moduleType })
           that.$previewRefresh(); //异步获取的图片需要刷新下
         }
-        that.$refs.inp.value = '';
+        // that.$refs.inp.value = '';
+        fileTag.value = '';
       });
     },
     imgBase64(file, callback) {