Browse Source

fix: rodoHeight在设置了dataSource时失效

lanjianrong 4 năm trước cách đây
mục cha
commit
3c014e0060
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      src/components/Table/src/BasicTable.tsx

+ 3 - 3
src/components/Table/src/BasicTable.tsx

@@ -77,10 +77,10 @@ const BasicTable: {
   )
 
   useLayoutEffect(() => {
-    if (state.dataSource) {
-      redoHeight(state.dataSource)
+    if (state.dataSource || !isUnDef(resetProps.dataSource)) {
+      redoHeight(state.dataSource || resetProps.dataSource)
     }
-  }, [state.dataSource])
+  }, [state.dataSource, resetProps.dataSource])
 
   /** 增加头部 */
   if (mainMenuType) {