diff --git a/docs/project_context.md b/docs/project_context.md index 2056e53..5a5d03d 100644 --- a/docs/project_context.md +++ b/docs/project_context.md @@ -1,5 +1,12 @@ # 项目上下文记录 +## 2026-05-18:恢复侧边栏原生收缩触发器 + +- `frontend/src/AppShell.vue` 移除顶部标题栏里的自定义汉堡收缩按钮,改用 Naive UI `n-layout-sider` 的 `show-trigger="bar"` 原生触发器。 +- 侧边栏收缩状态仍写入 `localStorage.sidebarCollapsed`,刷新页面后保持用户上次的展开/收缩状态。 +- `frontend/src/styles.css` 清理自定义 `.sidebar-toggle` 样式,避免顶部标题栏出现额外按钮。 +- 已执行 `npm run build`,构建通过;未启动浏览器或 headless Chrome。 + ## 2026-05-18:修正折叠侧边栏菜单图标居中 - `frontend/src/styles.css` 的折叠侧边栏菜单项强制改为 flex 居中布局,避免 Naive Menu 折叠时透明文本列继续占据 grid 空间导致图标偏左。 diff --git a/frontend/src/AppShell.vue b/frontend/src/AppShell.vue index 254fad2..16bf383 100644 --- a/frontend/src/AppShell.vue +++ b/frontend/src/AppShell.vue @@ -7,7 +7,8 @@ :collapsed="sidebarCollapsed" :collapsed-width="64" :width="220" - @update:collapsed="sidebarCollapsed = $event" + show-trigger="bar" + @update:collapsed="handleSidebarCollapsed" >