diff --git a/ruoyi-ui/src/assets/styles/index.scss b/ruoyi-ui/src/assets/styles/index.scss index bb87292..240f7d4 100644 --- a/ruoyi-ui/src/assets/styles/index.scss +++ b/ruoyi-ui/src/assets/styles/index.scss @@ -176,3 +176,20 @@ aside { margin-bottom: 10px; } } + +// 固定导航栏 +.fixed-header { + position: fixed; + top: 0; + right: 0; + // left: 0; + width: 100%; + z-index: 999; + box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08); +} + +// 调整内容区域位置(防止被导航栏遮挡) +.app-main { + padding-top: 50px; // 根据导航栏实际高度调整 + min-height: calc(100vh - 50px); // 保持高度正确 +} \ No newline at end of file diff --git a/ruoyi-ui/src/layout/components/Navbar.vue b/ruoyi-ui/src/layout/components/Navbar.vue index 5e37e98..01b961b 100644 --- a/ruoyi-ui/src/layout/components/Navbar.vue +++ b/ruoyi-ui/src/layout/components/Navbar.vue @@ -1,5 +1,5 @@