修复移动端100vh兼容性

This commit is contained in:
whyour
2021-05-11 19:37:37 +08:00
parent d9db5442d3
commit 49a3662788
12 changed files with 45 additions and 40 deletions
+27 -6
View File
@@ -6,10 +6,13 @@ body {
@import '~codemirror/lib/codemirror.css';
.code-mirror-wrapper .CodeMirror {
position: absolute;
height: calc(100vh - 128px);
width: calc(100% - 32px);
.ql-container-wrapper {
.CodeMirror {
position: absolute;
height: calc(100vh - 128px);
height: calc(100vh - var(--vh-offset, 0px) - 128px);
width: calc(100% - 32px);
}
}
.ant-pro-grid-content.wide {
@@ -18,6 +21,7 @@ body {
.ant-pro-page-container-children-content {
overflow: auto;
height: calc(100vh - 96px);
height: calc(100vh - var(--vh-offset, 0px) - 96px);
background-color: #fff;
padding: 16px;
}
@@ -29,13 +33,30 @@ body {
}
}
.log-select {
width: 300px;
}
@media (max-width: 768px) {
.ant-pro-grid-content.wide {
.ant-pro-page-container-children-content {
height: calc(100vh - 144px);
height: calc(100vh - var(--vh-offset, 0px) - 144px);
}
}
.code-mirror-wrapper .CodeMirror {
height: calc(100vh - 176px);
.ql-container-wrapper {
&.crontab-wrapper {
.ant-pro-grid-content.wide .ant-pro-page-container-children-content {
height: calc(100vh - 184px);
height: calc(100vh - var(--vh-offset, 0px) - 184px);
}
}
.CodeMirror {
height: calc(100vh - 176px);
height: calc(100vh - var(--vh-offset, 0px) - 176px);
}
}
.log-select {
width: 200px;
}
}
+2
View File
@@ -13,6 +13,7 @@ import config from '@/utils/config';
import 'codemirror/mode/shell/shell.js';
import { request } from '@/utils/http';
import './index.less';
import vhCheck from 'vh-check';
export default function (props: any) {
const logout = () => {
@@ -27,6 +28,7 @@ export default function (props: any) {
if (!isAuth) {
history.push('/login');
}
vhCheck();
}, []);
useEffect(() => {