fix(navigation): 统一 redirectToPage 方法;修复内容区域宽度

- 各页面 redirectToPage 统一为直接跳转 page 参数
- 组件样式增加 main-content margin-left 避免内容被侧边栏遮挡
- 确保固定侧边栏与主内容布局正确
This commit is contained in:
lt
2026-05-08 12:42:03 +08:00
parent c85320ae72
commit 2220d7b981
3 changed files with 14 additions and 2 deletions
+1 -1
View File
@@ -134,7 +134,7 @@
}
},
handleLogout() { localStorage.removeItem('authToken'); window.location.href = '/'; },
redirectToPage(page) { window.location.href = '/' + page; }
redirectToPage(page) { window.location.href = page; }
},
mounted() {
const token = localStorage.getItem('authToken');
+12
View File
@@ -35,6 +35,18 @@
.navigation-wrapper .mobile-nav { display: flex !important; }
}
@media (min-width: 769px) { .navigation-wrapper .mobile-nav { display: none !important; } }
/* 主内容区域避开固定侧边栏 */
body > #app > .navigation-wrapper + .main-content,
body > #app > .main-content {
margin-left: 180px !important;
}
@media (max-width: 768px) {
body > #app > .navigation-wrapper + .main-content,
body > #app > .main-content {
margin-left: 0 !important;
padding-bottom: 60px !important;
}
}
/* 侧边栏固定定位时不调整主内容,让 main-content 自然位于文档流中,仅需确保 padding-top 避开 navbar */
body > #app > .main-content { padding-top: 0; }
`;
+1 -1
View File
@@ -602,7 +602,7 @@ const TopicsApp = {
.catch(() => {});
},
handleLogout() { localStorage.removeItem('authToken'); window.location.href = '/'; },
redirectToPage(page) { window.location.href = page.startsWith('/') ? page : '/' + page; },
redirectToPage(page) { window.location.href = page; },
getStatusLabel(status) {
const statusMap = {
'pending': '待处理',