Files
smart-go/web/lib/hooks/use-menu-navigation.ts
T
2026-04-23 18:58:13 +08:00

15 lines
390 B
TypeScript

'use client';
import { useRouter } from 'next/navigation';
import { useTabStore } from '@/stores/tab-store';
/** 站内导航 + 多标签联动,替代 onMenuNavigate prop drilling */
export function useMenuNavigation() {
const router = useRouter();
return (path: string, title: string) => {
useTabStore.getState().openOrActivate({ path, title });
router.push(path);
};
}