更新动态路径,和IP管理的badge显示
This commit is contained in:
@@ -8,7 +8,7 @@ type Props = {
|
||||
collapsed?: boolean
|
||||
}
|
||||
|
||||
// 简化的菜单配置 - 扁平结构,支持分组
|
||||
// 菜单配置 - 扁平结构,支持分组
|
||||
const MENU_ITEMS = [
|
||||
{
|
||||
group: '官网教程',
|
||||
@@ -70,10 +70,10 @@ const MENU_ITEMS = [
|
||||
export default function Sidebar({collapsed = false}: Props) {
|
||||
const pathname = usePathname()
|
||||
|
||||
// 获取当前文档 key (从 /help/{key} 路径中提取)
|
||||
// 获取当前文档 key
|
||||
const getCurrentKey = useCallback(() => {
|
||||
const parts = pathname?.split('/') || []
|
||||
return parts[2] || '' // /help/{key} -> key
|
||||
return parts[2] || ''
|
||||
}, [pathname])
|
||||
|
||||
const currentKey = getCurrentKey()
|
||||
|
||||
Reference in New Issue
Block a user