Nextjs Routing with activeClassName and Ant Design Menus



可能很愚蠢的问题 - Antd 使用selectedKeys字段来确定菜单中的哪些项目应该突出显示,Nextjs 在 Link 组件中使用 activeClassName 参数来提供页面当前处于活动状态时要添加的类。如何使用 Ant Design 菜单在 Nextjs 中最好地设计导航页面并协调这两种方法?

您可以使用 nextjs with ROuter 来获取路由器对象,使用它来确定哪个是选定的键

最新更新