feat: 优化web
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
'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);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user