修复表格初次获取滚动高度

This commit is contained in:
whyour 2021-10-23 23:44:11 +08:00
parent 2e00e80e96
commit a479f0fbce
3 changed files with 9 additions and 3 deletions

View File

@ -763,7 +763,9 @@ const Crontab = ({ headerStyle, isPhone }: any) => {
useEffect(() => {
setPageSize(parseInt(localStorage.getItem('pageSize') || '20'));
const offset = isPhone ? 40 : 0;
setTableScrollHeight(getTableScroll() - offset);
setTimeout(() => {
setTableScrollHeight(getTableScroll() - offset);
});
}, []);
return (

View File

@ -299,7 +299,9 @@ const Dependence = ({ headerStyle, isPhone, ws }: any) => {
useEffect(() => {
const offset = isPhone ? 40 : 0;
setTableScrollHeight(getTableScroll({ extraHeight: 87 }) - offset);
setTimeout(() => {
setTableScrollHeight(getTableScroll({ extraHeight: 87 }) - offset);
});
}, []);
useEffect(() => {

View File

@ -438,7 +438,9 @@ const Env = ({ headerStyle, isPhone, theme }: any) => {
useEffect(() => {
const offset = isPhone ? 40 : 0;
setTableScrollHeight(getTableScroll({ extraHeight: 87 }) - offset);
setTimeout(() => {
setTableScrollHeight(getTableScroll({ extraHeight: 87 }) - offset);
});
}, []);
return (