生产管理系统前端 - 页面主区域滚动条fix

This commit is contained in:
2025-10-27 11:46:35 +08:00
parent c0ea1fb9f3
commit 5055e40de6
3 changed files with 13 additions and 3 deletions

View File

@@ -222,7 +222,7 @@ export function SideBarOld({
return ( return (
<div className={cn( <div className={cn(
"flex h-full bg-background", "flex h-full bg-background",
"min-h-screen" "min-h-0" // 确保父容器有正确的高度约束
)}> )}>
{/* 左侧导航栏 - 独立滚动 */} {/* 左侧导航栏 - 独立滚动 */}
{!isMobile && ( {!isMobile && (

View File

@@ -62,8 +62,8 @@ export function MainContent({
} }
return ( return (
<div className="flex-1 flex flex-col bg-background"> <div className="flex-1 flex flex-col bg-background h-full">
<div className="p-6"> <div className="flex-1 p-6 min-h-0 content-container">
{children} {children}
</div> </div>
</div> </div>

View File

@@ -23,9 +23,19 @@
.contentScroll{ .contentScroll{
height: 100%; height: 100%;
min-height: 0;
overflow-y: auto; overflow-y: auto;
} }
/* 内容容器底部间距 */
.content-container::after {
content: '';
display: block;
height: 2rem; /* 5rem 底部间距 */
width: 100%;
flex-shrink: 0;
}
/* 滚动条颜色变量 */ /* 滚动条颜色变量 */
:root { :root {
--scrollbar-color: #d1d5db; --scrollbar-color: #d1d5db;