适配移动端

This commit is contained in:
CaIon
2023-11-25 17:30:46 +08:00
parent 3121afd2e0
commit 4f09b3c7ce
2 changed files with 17 additions and 2 deletions

View File

@@ -95,7 +95,7 @@ let headerButtons = [
// } // }
]; ];
const HeaderBar = () => { const SiderBar = () => {
const [userState, userDispatch] = useContext(UserContext); const [userState, userDispatch] = useContext(UserContext);
let navigate = useNavigate(); let navigate = useNavigate();
const [selectedKeys, setSelectedKeys] = useState(['home']); const [selectedKeys, setSelectedKeys] = useState(['home']);
@@ -119,6 +119,7 @@ const HeaderBar = () => {
<Nav <Nav
// mode={'horizontal'} // mode={'horizontal'}
// bodyStyle={{ height: 100 }} // bodyStyle={{ height: 100 }}
defaultIsCollapsed={isMobile()}
selectedKeys={selectedKeys} selectedKeys={selectedKeys}
renderWrapper={({itemElement, isSubNav, isInSubNav, props}) => { renderWrapper={({itemElement, isSubNav, isInSubNav, props}) => {
const routerMap = { const routerMap = {
@@ -166,4 +167,4 @@ const HeaderBar = () => {
); );
}; };
export default HeaderBar; export default SiderBar;

View File

@@ -15,6 +15,20 @@ body {
height: 100%; height: 100%;
} }
@media only screen and (max-width: 767px) {
.semi-table-tbody, .semi-table-row, .semi-table-row-cell {
display: block!important;
width: auto!important;
padding: 2px!important;
}
.semi-table-row-cell {
border-bottom: 0!important;
}
.semi-table-tbody>.semi-table-row {
border-bottom: 1px solid rgba(0,0,0,.1);
}
}
.semi-layout { .semi-layout {
height: 100%; height: 100%;
} }