Commit 4c5df378 authored by godkaikai's avatar godkaikai

Revert "解决sql编辑器因浏览器宽高改变而消失的问题"

This reverts commit ded7f026.
parent ded7f026
...@@ -21,14 +21,11 @@ type StudioProps = { ...@@ -21,14 +21,11 @@ type StudioProps = {
rightClickMenu: StateType['rightClickMenu']; rightClickMenu: StateType['rightClickMenu'];
dispatch: any; dispatch: any;
}; };
const elementwidth = document.documentElement.clientWidth;
const elementHeight = document.documentElement.clientHeight;
const Studio: React.FC<StudioProps> = (props) => { const Studio: React.FC<StudioProps> = (props) => {
const {rightClickMenu, toolHeight, toolLeftWidth,toolRightWidth, dispatch} = props; const {rightClickMenu, toolHeight, toolLeftWidth,toolRightWidth, dispatch} = props;
const [form] = Form.useForm(); const [form] = Form.useForm();
const VIEW = { const VIEW = {
leftToolWidth: 300, leftToolWidth: 300,
marginTop: 116, marginTop: 116,
...@@ -39,13 +36,13 @@ const Studio: React.FC<StudioProps> = (props) => { ...@@ -39,13 +36,13 @@ const Studio: React.FC<StudioProps> = (props) => {
midMargin: 46, midMargin: 46,
}; };
const [size, setSize] = useState({ const [size, setSize] = useState({
width: elementwidth - 1, width: document.documentElement.clientWidth - 1,
height: elementHeight, height: document.documentElement.clientHeight,
}); });
const onResize = useCallback(() => { const onResize = useCallback(() => {
setSize({ setSize({
width: elementwidth - 1, width: document.documentElement.clientWidth - 1,
height: elementHeight, height: document.documentElement.clientHeight,
}) })
}, []); }, []);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment