import { NavLink, useLocation } from 'react-router-dom'; import { ReactNode } from 'react'; import { AppBar, Tab, Tabs, Toolbar, } from '@mui/material'; interface RouteItem { path: string; label: string; element: ReactNode; } interface NavbarProps { items?: RouteItem[]; } function Navbar({ items = [] }: NavbarProps) { const location = useLocation(); // Chrome 扩展 popup 固定尺寸,全部显示在滚动标签中 // 精确匹配路由 const activeTabIndex = items.findIndex((item) => location.pathname === item.path); return ( {items.map((item) => ( ))} ); } export default Navbar;