修复表格滚动高度

This commit is contained in:
whyour
2022-10-25 23:12:38 +08:00
parent 68bb4f15e2
commit 48dd6ea826
4 changed files with 28 additions and 14 deletions
+5 -3
View File
@@ -168,6 +168,7 @@ const Dependence = () => {
const [logDependence, setLogDependence] = useState<any>();
const [isLogModalVisible, setIsLogModalVisible] = useState(false);
const [type, setType] = useState('nodejs');
const tableRef = useRef<any>();
const getDependencies = () => {
setLoading(true);
@@ -368,10 +369,10 @@ const Dependence = () => {
}, [searchText, type]);
useEffect(() => {
setTimeout(() => {
if (tableRef.current) {
setTableScrollHeight(getTableScroll({ extraHeight: 87 }));
});
}, []);
}
}, [tableRef.current]);
useEffect(() => {
if (logDependence) {
@@ -454,6 +455,7 @@ const Dependence = () => {
)}
<DndProvider backend={HTML5Backend}>
<Table
ref={tableRef}
columns={columns}
rowSelection={rowSelection}
pagination={false}