Commit ded7f026 authored by coderTomato's avatar coderTomato

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

parent ee851376
......@@ -21,11 +21,14 @@ type StudioProps = {
rightClickMenu: StateType['rightClickMenu'];
dispatch: any;
};
const elementwidth = document.documentElement.clientWidth;
const elementHeight = document.documentElement.clientHeight;
const Studio: React.FC<StudioProps> = (props) => {
const {rightClickMenu, toolHeight, toolLeftWidth,toolRightWidth, dispatch} = props;
const [form] = Form.useForm();
const VIEW = {
leftToolWidth: 300,
marginTop: 116,
......@@ -36,13 +39,13 @@ const Studio: React.FC<StudioProps> = (props) => {
midMargin: 46,
};
const [size, setSize] = useState({
width: document.documentElement.clientWidth - 1,
height: document.documentElement.clientHeight,
width: elementwidth - 1,
height: elementHeight,
});
const onResize = useCallback(() => {
setSize({
width: document.documentElement.clientWidth - 1,
height: document.documentElement.clientHeight,
width: elementwidth - 1,
height: elementHeight,
})
}, []);
......
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