lushixing 3 weeks ago
parent
commit
dd08926bd3
1 changed files with 7 additions and 6 deletions
  1. 7 6
      src/views/design-agent/feature-mod-index.vue

+ 7 - 6
src/views/design-agent/feature-mod-index.vue

@@ -675,13 +675,14 @@ export default {
     replaceFile(itemIndex) {
       this.replaceIndex = itemIndex
 
-      // 清空上传队列
-      this.$refs.uploadRef.uploadFiles = []
-
-      // 手动触发上传框选择文件
-      const input = this.$refs.uploadRef.$el.querySelector('input[type=file]')
-      input.click()
+      if (this.$refs.uploadRef) {
+        // 清空上传队列
+        this.$refs.uploadRef.uploadFiles = []
 
+        // 手动触发上传框选择文件
+        const input = this.$refs.uploadRef.$el.querySelector('input[type=file]')
+        input.click()
+      }
       // 在 handleSuccess 中会替换对应文件
     },
     beforeUploadVideo(file) {