修复ant-tree高度获取

This commit is contained in:
whyour 2022-09-25 13:38:10 +08:00
parent dcea231249
commit c36450f436
3 changed files with 11 additions and 5 deletions

View File

@ -131,7 +131,7 @@
"react-dnd": "^14.0.2",
"react-dnd-html5-backend": "^14.0.0",
"react-dom": "18.x",
"react-split-pane": "^0.1.92",
"react-split-pane": "git+https://github.com/tomkp/react-split-pane.git#master",
"sockjs-client": "^1.6.0",
"ts-node": "^10.6.0",
"tslib": "^2.4.0",

View File

@ -195,10 +195,13 @@ const Log = () => {
useEffect(() => {
getLogs();
if (treeDom && treeDom.current) {
}, []);
useEffect(() => {
if (treeDom.current) {
setHeight(treeDom.current.clientHeight);
}
}, []);
}, [treeDom.current, data]);
return (
<PageContainer

View File

@ -375,10 +375,13 @@ const Script = () => {
useEffect(() => {
getScripts();
if (treeDom && treeDom.current) {
}, []);
useEffect(() => {
if (treeDom.current) {
setHeight(treeDom.current.clientHeight);
}
}, []);
}, [treeDom.current, data]);
const action = (key: string | number) => {
switch (key) {