Parcourir la source

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

- 为"训练模式"导航项添加侧边栏关闭逻辑
- 为"视频回放"导航项添加侧边栏关闭逻辑
- 确保用户点击导航后侧边栏自动收起,提升移动端使用体验
yourname il y a 6 mois
Parent
commit
eeb71ee59f
1 fichiers modifiés avec 8 ajouts et 2 suppressions
  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);
+      }
     }
   ];