Sfoglia il codice sorgente

函数用简化写法

visuddhinanda 1 anno fa
parent
commit
c83b0cf267

+ 1 - 5
dashboard/src/components/template/Wbw/WbwDetail.tsx

@@ -211,11 +211,7 @@ const WbwDetailWidget = ({
                   console.debug("WbwDetailBasic onchange", e);
                   fieldChanged(e.field, e.value);
                 }}
-                onRelationAdd={() => {
-                  if (typeof onClose !== "undefined") {
-                    onClose();
-                  }
-                }}
+                onRelationAdd={onClose}
               />
             ),
           },

+ 1 - 5
dashboard/src/components/template/Wbw/WbwDetailBasic.tsx

@@ -267,11 +267,7 @@ const WbwDetailBasicWidget = ({
               onChange(e);
             }
           }}
-          onRelationAdd={() => {
-            if (typeof onRelationAdd !== "undefined") {
-              onRelationAdd();
-            }
-          }}
+          onRelationAdd={onRelationAdd}
         />
       </Form>
     </>

+ 1 - 5
dashboard/src/components/template/Wbw/WbwDetailBasicRelation.tsx

@@ -67,11 +67,7 @@ const WbwDetailBasicRelationWidget = ({
               onChange(e);
             }
           }}
-          onAdd={() => {
-            if (typeof onRelationAdd !== "undefined") {
-              onRelationAdd();
-            }
-          }}
+          onAdd={onRelationAdd}
           onFromList={(value: string[]) => setFromList(value)}
         />
       </Collapse.Panel>