Sfoglia il codice sorgente

🐛 fix(mobile): 修复侧边栏导航后未自动关闭的问题

- 为"训练模式"导航项添加侧边栏关闭逻辑
- 为"视频回放"导航项添加侧边栏关闭逻辑
- 确保用户点击导航后侧边栏自动收起,提升移动端使用体验
yourname 6 mesi fa
parent
commit
eeb71ee59f
1 ha cambiato i file con 8 aggiunte e 2 eliminazioni
  1. 8 2
      src/client/mobile/layouts/MainLayout.tsx

+ 8 - 2
src/client/mobile/layouts/MainLayout.tsx

@@ -56,13 +56,19 @@ export const MainLayout = () => {
       id: 'training',
       label: '训练模式',
       icon: <Heart className="w-5 h-5" />,
-      onClick: () => navigate('/mobile/xunlian')
+      onClick: () => {
+        navigate('/mobile/xunlian');
+        setSidebarOpen(false);
+      }
     },
     {
       id: 'video-replay',
       label: '视频回放',
       icon: <Video className="w-5 h-5" />,
-      onClick: () => navigate('/mobile/video-replay')
+      onClick: () => {
+        navigate('/mobile/video-replay');
+        setSidebarOpen(false);
+      }
     }
   ];