howie пре 3 година
родитељ
комит
8d0be567df
1 измењених фајлова са 7 додато и 7 уклоњено
  1. 7 7
      src/components/Common/image-upload.vue

+ 7 - 7
src/components/Common/image-upload.vue

@@ -228,17 +228,17 @@ export default {
 
         if (this.startRestricting) {
           if (this.fileList.length) {
-            this.fileList.forEach(k => {
-              if (k.name.split('.')[0] === file.name.split('.')[0]) {
-                k.name = this.waitUploadList[index].name
-                k.url = this.waitUploadList[index].key
-                k.hover = false
+            for (let i = 0; i <this.fileList.length ; i++) {
+              if (this.fileList[i].name.split('.')[0] === file.name.split('.')[0]) {
+                this.fileList[i].name = this.waitUploadList[index].name
+                this.fileList[i].url = this.waitUploadList[index].key
+                this.fileList[i].hover = false
                 this.waitUploadList.splice(index, 1)
                 this.showFileList = true
                 loading.close()
+                return false
               }
-            })
-            return false
+            }
           }
         }
         this.fileList.push({