zlisen 3 lat temu
rodzic
commit
f7e7eafbcc
1 zmienionych plików z 7 dodań i 3 usunięć
  1. 7
    3
      src/components/XForm/ImageListUpload.jsx

+ 7
- 3
src/components/XForm/ImageListUpload.jsx Wyświetl plik

@@ -49,9 +49,13 @@ class ImageListUpload extends React.Component {
49 49
         okText: '确认',
50 50
         okType: 'danger',
51 51
         cancelText: '取消',
52
-        onOk() {
53
-          const fileList = (this.props.value || []).filter(x => getImgURL(x) != e.file.url);
54
-          this.props.onChange(fileList);
52
+        onOk:() =>{
53
+ 
54
+          if (typeof this.props?.onChange === 'function') {
55
+            const fileList = (this.props.value || []).filter(x => getImgURL(x) != e.file.url);
56
+            this.props.onChange(fileList);
57
+          }
58
+         
55 59
         },
56 60
       });
57 61
     }