侧边栏菜单
配置仪表盘页面的导航菜单
定义后台管理页面的左侧边栏导航菜单,每个项目都是 NestedMenuItem。
配置仪表盘页面的导航菜单
定义后台管理页面的左侧边栏导航菜单,每个项目都是 NestedMenuItem。
export function getSidebarLinks(): NestedMenuItem[] {
const t = useTranslations('Dashboard');
return [
{
title: t('dashboard.title'),
icon: <LayoutDashboardIcon className="size-4 shrink-0" />,
href: Routes.Dashboard,
external: false,
},
{
title: t('admin.title'),
icon: <SettingsIcon
侧边栏配置类似于导航栏,但专门为仪表盘区域设计。它支持:
authorizeOnly 属性实现菜单只有特定角色可见侧边栏非常适合根据用户角色提供不同的菜单,例如普通用户只能看到仪表盘,管理员可以看到用户管理页面等。

现在您了解了侧边栏配置,请探索其他相关主题: