zhujindu před 2 týdny
rodič
revize
ce6718f69c
1 změnil soubory, kde provedl 6 přidání a 2 odebrání
  1. 6 2
      src/components/deleteUploadImgTaskPhoto.vue

+ 6 - 2
src/components/deleteUploadImgTaskPhoto.vue

@@ -119,12 +119,16 @@ export default {
       });
     },
     newimgarr(localIds) {
+      // 防御性处理,确保 this.imgArr 一定为数组
+      if (!Array.isArray(this.imgArr)) {
+        this.imgArr = [];
+      }
       if (this.isIOS()) {
-        this.imgArr = this.imgArr.concat(localIds);
+        this.imgArr = this.imgArr.concat([...localIds]);
         // 解决ios微信localId无法直接使用的问题,获取base64后再上传
         // this.setIosImg(localIds);
       } else {
-        this.imgArr = this.imgArr.concat(localIds);
+        this.imgArr = this.imgArr.concat([...localIds]);
       }
       // this.$emit('upDataDetail');
     },